diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index a394e6b9f..f9cffcae9 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -1630,30 +1630,6 @@ has_touchscreen (MetaSeatImpl *seat_impl) return FALSE; } -static inline gboolean -device_type_is_pointer (ClutterInputDeviceType device_type) -{ - return device_type == CLUTTER_POINTER_DEVICE || - device_type == CLUTTER_TOUCHPAD_DEVICE; -} - -static gboolean -has_pointer (MetaSeatImpl *seat_impl) -{ - GSList *l; - - for (l = seat_impl->devices; l; l = l->next) - { - ClutterInputDeviceType device_type; - - device_type = clutter_input_device_get_device_type (l->data); - if (device_type_is_pointer (device_type)) - return TRUE; - } - - return FALSE; -} - static gboolean device_is_tablet_switch (MetaInputDeviceNative *device_native) { @@ -1693,14 +1669,11 @@ update_touch_mode (MetaSeatImpl *seat_impl) /* If we have a tablet mode switch, honor it being unset */ else if (seat_impl->has_tablet_switch && !seat_impl->tablet_mode_switch_state) touch_mode = FALSE; - /* If tablet mode is enabled, go for it */ - else if (seat_impl->has_tablet_switch && seat_impl->tablet_mode_switch_state) - touch_mode = TRUE; - /* If there is no tablet mode switch (eg. kiosk machines), - * assume touch-mode is mutually exclusive with pointers. + /* If tablet mode is enabled, or if there is no tablet mode switch + * (eg. kiosk machines), assume touch-mode. */ else - touch_mode = !seat_impl->has_pointer; + touch_mode = TRUE; if (seat_impl->touch_mode != touch_mode) { @@ -1720,7 +1693,7 @@ evdev_add_device (MetaSeatImpl *seat_impl, { ClutterInputDeviceType type; ClutterInputDevice *device; - gboolean is_touchscreen, is_tablet_switch, is_pointer; + gboolean is_touchscreen, is_tablet_switch; device = meta_input_device_native_new_in_impl (seat_impl, libinput_device); @@ -1734,13 +1707,11 @@ evdev_add_device (MetaSeatImpl *seat_impl, is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE; is_tablet_switch = device_is_tablet_switch (META_INPUT_DEVICE_NATIVE (device)); - is_pointer = device_type_is_pointer (type); seat_impl->has_touchscreen |= is_touchscreen; seat_impl->has_tablet_switch |= is_tablet_switch; - seat_impl->has_pointer |= is_pointer; - if (is_touchscreen || is_tablet_switch || is_pointer) + if (is_touchscreen || is_tablet_switch) update_touch_mode (seat_impl); if (type == CLUTTER_KEYBOARD_DEVICE) @@ -1764,7 +1735,7 @@ evdev_remove_device (MetaSeatImpl *seat_impl, { ClutterInputDevice *device; ClutterInputDeviceType device_type; - gboolean is_touchscreen, is_tablet_switch, is_pointer; + gboolean is_touchscreen, is_tablet_switch; device = CLUTTER_INPUT_DEVICE (device_native); seat_impl->devices = g_slist_remove (seat_impl->devices, device); @@ -1773,16 +1744,13 @@ evdev_remove_device (MetaSeatImpl *seat_impl, is_touchscreen = device_type == CLUTTER_TOUCHSCREEN_DEVICE; is_tablet_switch = device_is_tablet_switch (device_native); - is_pointer = device_type_is_pointer (device_type); if (is_touchscreen) seat_impl->has_touchscreen = has_touchscreen (seat_impl); if (is_tablet_switch) seat_impl->has_tablet_switch = has_tablet_switch (seat_impl); - if (is_pointer) - seat_impl->has_pointer = has_pointer (seat_impl); - if (is_touchscreen || is_tablet_switch || is_pointer) + if (is_touchscreen || is_tablet_switch) update_touch_mode (seat_impl); if (seat_impl->repeat_source && seat_impl->repeat_device == device) diff --git a/src/backends/native/meta-seat-impl.h b/src/backends/native/meta-seat-impl.h index ff614586a..3fd05ae12 100644 --- a/src/backends/native/meta-seat-impl.h +++ b/src/backends/native/meta-seat-impl.h @@ -100,7 +100,6 @@ struct _MetaSeatImpl gboolean tablet_mode_switch_state; gboolean has_touchscreen; gboolean has_tablet_switch; - gboolean has_pointer; gboolean touch_mode; gboolean input_thread_initialized;