|
|
776610 |
From dd49a4985c8e0bbe51d5784fd89363d496eae350 Mon Sep 17 00:00:00 2001
|
|
|
776610 |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
776610 |
Date: Tue, 13 Feb 2018 11:44:40 +0100
|
|
|
776610 |
Subject: [PATCH] clutter: Extend touchpad device property check for Synaptics
|
|
|
776610 |
|
|
|
776610 |
So we reliably get CLUTTER_TOUCHPAD_DEVICE for those. The other heuristics
|
|
|
776610 |
to get the device type may fall short.
|
|
|
776610 |
---
|
|
|
776610 |
.../clutter/x11/clutter-device-manager-xi2.c | 22 ++++++++++++++++---
|
|
|
776610 |
1 file changed, 19 insertions(+), 3 deletions(-)
|
|
|
776610 |
|
|
|
776610 |
diff --git a/clutter/clutter/x11/clutter-device-manager-xi2.c b/clutter/clutter/x11/clutter-device-manager-xi2.c
|
|
|
776610 |
index 62f558380..6794a2e0c 100644
|
|
|
776610 |
--- a/clutter/clutter/x11/clutter-device-manager-xi2.c
|
|
|
776610 |
+++ b/clutter/clutter/x11/clutter-device-manager-xi2.c
|
|
|
776610 |
@@ -267,8 +267,9 @@ is_touch_device (XIAnyClassInfo **classes,
|
|
|
776610 |
}
|
|
|
776610 |
|
|
|
776610 |
static gboolean
|
|
|
776610 |
-is_touchpad_device (ClutterBackendX11 *backend_x11,
|
|
|
776610 |
- XIDeviceInfo *info)
|
|
|
776610 |
+query_exists_device_property (ClutterBackendX11 *backend_x11,
|
|
|
776610 |
+ XIDeviceInfo *info,
|
|
|
776610 |
+ const gchar *property)
|
|
|
776610 |
{
|
|
|
776610 |
gulong nitems, bytes_after;
|
|
|
776610 |
guint32 *data = NULL;
|
|
|
776610 |
@@ -276,7 +277,7 @@ is_touchpad_device (ClutterBackendX11 *backend_x11,
|
|
|
776610 |
Atom type;
|
|
|
776610 |
Atom prop;
|
|
|
776610 |
|
|
|
776610 |
- prop = XInternAtom (backend_x11->xdpy, "libinput Tapping Enabled", True);
|
|
|
776610 |
+ prop = XInternAtom (backend_x11->xdpy, property, True);
|
|
|
776610 |
if (prop == None)
|
|
|
776610 |
return FALSE;
|
|
|
776610 |
|
|
|
776610 |
@@ -297,6 +298,21 @@ is_touchpad_device (ClutterBackendX11 *backend_x11,
|
|
|
776610 |
return TRUE;
|
|
|
776610 |
}
|
|
|
776610 |
|
|
|
776610 |
+static gboolean
|
|
|
776610 |
+is_touchpad_device (ClutterBackendX11 *backend_x11,
|
|
|
776610 |
+ XIDeviceInfo *info)
|
|
|
776610 |
+{
|
|
|
776610 |
+ if (query_exists_device_property (backend_x11, info,
|
|
|
776610 |
+ "libinput Tapping Enabled"))
|
|
|
776610 |
+ return TRUE;
|
|
|
776610 |
+
|
|
|
776610 |
+ if (query_exists_device_property (backend_x11, info,
|
|
|
776610 |
+ "Synaptics Off"))
|
|
|
776610 |
+ return TRUE;
|
|
|
776610 |
+
|
|
|
776610 |
+ return FALSE;
|
|
|
776610 |
+}
|
|
|
776610 |
+
|
|
|
776610 |
static gboolean
|
|
|
776610 |
get_device_ids (ClutterBackendX11 *backend_x11,
|
|
|
776610 |
XIDeviceInfo *info,
|
|
|
776610 |
--
|
|
|
776610 |
2.20.1
|
|
|
776610 |
|