[mutter/wip/carlosg/device-check] backend/native: Check libinput_device in async call




commit 446839c0d09b210b4ddaa657975d3f2da1391686
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Dec 16 19:14:54 2020 +0100

    backend/native: Check libinput_device in async call
    
    Power saving changes in laptop panels enable/disable the attached
    touchscreen input device, this is an asynchronous operation that
    may be happening while the device is disappearing.
    
    In fact, closing the lid is such perfect storm where both things
    happen around the same time.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1644>

 src/backends/native/meta-input-settings-native.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/native/meta-input-settings-native.c 
b/src/backends/native/meta-input-settings-native.c
index 3f9f71fe7f..ba6ec6d26c 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -108,7 +108,8 @@ set_send_events (GTask *task)
     }
 
   libinput_device = meta_input_device_native_get_libinput_device (device);
-  libinput_device_config_send_events_set_mode (libinput_device, libinput_mode);
+  if (libinput_device)
+    libinput_device_config_send_events_set_mode (libinput_device, libinput_mode);
 
   return G_SOURCE_REMOVE;
 }


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