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

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