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