[mutter/wip/carlosg/input-thread: 57/159] backend: Don't emit last-device updates with no device




commit 32128db91c8f4009caa313e6ed655562b5d7d54d
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Jul 15 00:49:08 2020 +0200

    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 8145565dab..7e9f1b4e13 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]