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

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