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
This commit is contained in:
Hans de Goede 2020-10-14 21:17:13 +02:00 committed by Carlos Garnacho
parent b5d21f00f8
commit 6c240dc83b

View File

@ -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) &&