[mutter] seat-native: Fix has_touchscreen becoming FALSE when a non touchscreen device gets added



commit 6c240dc83b33d26696825c6ee70560e201542fd7
Author: Hans de Goede <hdegoede redhat com>
Date:   Wed Oct 14 21:17:13 2020 +0200

    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 c530826084..8f8f13a099 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) &&


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