From 0756826753acf058bc7408fc0feecffd365b10ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 15 Jul 2020 00:49:08 +0200 Subject: [PATCH] backend: Don't emit last-device updates with no device When removing a device that has been just marked as the last in use, we may try to notify that a NULL device is the last one. This is not supported, as both update_last_device() and the clients of the "::last-device-changed" signal are assuming that the last device is always a valid ClutterInputDevice. So let's avoid erroring, and stop the idle when clearing the current device. Related to: https://gitlab.gnome.org/GNOME/mutter/-/issues/1345 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1371 --- src/backends/meta-backend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 829c9f5ff..115fba505 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -438,6 +438,7 @@ on_device_removed (ClutterSeat *seat, ClutterInputDeviceType device_type; priv->current_device = NULL; + g_clear_handle_id (&priv->device_update_idle_id, g_source_remove); device_type = clutter_input_device_get_device_type (device); has_touchscreen = check_has_slave_touchscreen (seat);