Blame SOURCES/0001-backends-Always-enable-tap-to-click-drag-on-opaque-W.patch

1a3082
From eeff82f534f81b086d10d53124362d9e316e2cf9 Mon Sep 17 00:00:00 2001
1a3082
From: Carlos Garnacho <carlosg@gnome.org>
1a3082
Date: Thu, 12 Dec 2019 18:05:08 +0100
1a3082
Subject: [PATCH] backends: Always enable tap-to-click/drag on opaque Wacom
1a3082
 tablets
1a3082
1a3082
Touch-wise, those are essentially giant touchpads, but have no buttons
1a3082
associated to the "touchpad" device (There may be pad buttons, but
1a3082
those are not mouse buttons).
1a3082
1a3082
Without tap-to-click/drag, touch in those devices is somewhat useless
1a3082
out of the box. Have them always enable these features, despite the
1a3082
setting.
1a3082
1a3082
https://gitlab.gnome.org/GNOME/mutter/merge_requests/968
1a3082
---
1a3082
 src/backends/meta-input-settings.c | 33 ++++++++++++++++++++++++++++--
1a3082
 1 file changed, 31 insertions(+), 2 deletions(-)
1a3082
1a3082
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
1a3082
index 2e6672d9c..28dc387ef 100644
1a3082
--- a/src/backends/meta-input-settings.c
1a3082
+++ b/src/backends/meta-input-settings.c
1a3082
@@ -517,6 +517,33 @@ update_touchpad_disable_while_typing (MetaInputSettings  *input_settings,
1a3082
     }
1a3082
 }
1a3082
 
1a3082
+static gboolean
1a3082
+device_is_tablet_touchpad (MetaInputSettings  *input_settings,
1a3082
+                           ClutterInputDevice *device)
1a3082
+{
1a3082
+#ifdef HAVE_LIBWACOM
1a3082
+  WacomIntegrationFlags flags = 0;
1a3082
+  WacomDevice *wacom_device;
1a3082
+
1a3082
+  if (clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
1a3082
+    return FALSE;
1a3082
+
1a3082
+  wacom_device =
1a3082
+    meta_input_settings_get_tablet_wacom_device (input_settings,
1a3082
+                                                 device);
1a3082
+  if (wacom_device)
1a3082
+    {
1a3082
+      flags = libwacom_get_integration_flags (wacom_device);
1a3082
+
1a3082
+      if ((flags & (WACOM_DEVICE_INTEGRATED_SYSTEM |
1a3082
+                    WACOM_DEVICE_INTEGRATED_DISPLAY)) == 0)
1a3082
+        return TRUE;
1a3082
+    }
1a3082
+#endif
1a3082
+
1a3082
+  return FALSE;
1a3082
+}
1a3082
+
1a3082
 static void
1a3082
 update_touchpad_tap_enabled (MetaInputSettings  *input_settings,
1a3082
                              ClutterInputDevice *device)
1a3082
@@ -531,7 +558,8 @@ update_touchpad_tap_enabled (MetaInputSettings  *input_settings,
1a3082
 
1a3082
   priv = meta_input_settings_get_instance_private (input_settings);
1a3082
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
1a3082
-  enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
1a3082
+  enabled = device_is_tablet_touchpad (input_settings, device) ||
1a3082
+    g_settings_get_boolean (priv->touchpad_settings, "tap-to-click");
1a3082
 
1a3082
   if (device)
1a3082
     {
1a3082
@@ -561,7 +589,8 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings  *input_settings,
1a3082
 
1a3082
   priv = meta_input_settings_get_instance_private (input_settings);
1a3082
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
1a3082
-  enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
1a3082
+  enabled = device_is_tablet_touchpad (input_settings, device) ||
1a3082
+    g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag");
1a3082
 
1a3082
   if (device)
1a3082
     {
1a3082
-- 
1a3082
2.23.0
1a3082