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

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