From 446839c0d09b210b4ddaa657975d3f2da1391686 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 16 Dec 2020 19:14:54 +0100 Subject: [PATCH] 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: --- 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 3f9f71fe7..ba6ec6d26 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; }