summarylogtreecommitdiffstats
path: root/0001-Revert-backends-native-Disable-touch-mode-with-point.patch
diff options
context:
space:
mode:
authorparcimonic2022-07-14 11:04:02 -0300
committerparcimonic2022-07-14 11:05:21 -0300
commit8b2ca7f74a4dfb5ee329959d34325e4b4e71a408 (patch)
treea26073677951c5616a0c2e31cf357976577da7f1 /0001-Revert-backends-native-Disable-touch-mode-with-point.patch
downloadaur-8b2ca7f74a4dfb5ee329959d34325e4b4e71a408.tar.gz
Initial commit
Diffstat (limited to '0001-Revert-backends-native-Disable-touch-mode-with-point.patch')
-rw-r--r--0001-Revert-backends-native-Disable-touch-mode-with-point.patch117
1 files changed, 117 insertions, 0 deletions
diff --git a/0001-Revert-backends-native-Disable-touch-mode-with-point.patch b/0001-Revert-backends-native-Disable-touch-mode-with-point.patch
new file mode 100644
index 000000000000..6e8e8403f3e9
--- /dev/null
+++ b/0001-Revert-backends-native-Disable-touch-mode-with-point.patch
@@ -0,0 +1,117 @@
+diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
+index 624b2fe6f..d130d634b 100644
+--- a/src/backends/native/meta-seat-impl.c
++++ b/src/backends/native/meta-seat-impl.c
+@@ -1559,30 +1559,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)
+ {
+@@ -1622,14 +1598,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)
+ {
+@@ -1649,7 +1622,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);
+
+@@ -1663,13 +1636,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);
+
+ return device;
+@@ -1681,7 +1652,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);
+@@ -1690,16 +1661,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 d3e2ab860..14ec75dc1 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;
+
+--