Blame SOURCES/0001-clutter-Extend-touchpad-device-property-check-for-Sy.patch

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