From 6c240dc83b33d26696825c6ee70560e201542fd7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 14 Oct 2020 21:17:13 +0200 Subject: [PATCH] seat-native: Fix has_touchscreen becoming FALSE when a non touchscreen device gets added Unconditionally setting has_touchscreen to check_touch_mode when a new device gets added leads to has_touchscreen becoming false when during runtime e.g. an USB keyboard gets plugged in. Fix this by setting has_touchscreen to TRUE when check_touch_mode is TRUE and leaving it alone otherwise. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1506 --- src/backends/native/meta-seat-native.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c index c53082608..8f8f13a09 100644 --- a/src/backends/native/meta-seat-native.c +++ b/src/backends/native/meta-seat-native.c @@ -1450,7 +1450,8 @@ meta_seat_native_handle_device_event (ClutterSeat *seat, switch (event->type) { case CLUTTER_DEVICE_ADDED: - seat_native->has_touchscreen = check_touch_mode; + if (check_touch_mode) + seat_native->has_touchscreen = TRUE; if (libinput_device_has_capability (device_native->libinput_device, LIBINPUT_DEVICE_CAP_SWITCH) &&