summarylogtreecommitdiffstats
path: root/0001-Revert-backends-native-Disable-touch-mode-with-point.patch
blob: bbd4bfffc9660c1626b7f4a826c54e758f09fe3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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;