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

88c283
From 368fdebe8f4f4e0c0e41f5be9961a748f328cb57 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
88c283
index 87da4b050..297d3acfe 100644
776610
--- a/clutter/clutter/x11/clutter-device-manager-xi2.c
776610
+++ b/clutter/clutter/x11/clutter-device-manager-xi2.c
88c283
@@ -282,8 +282,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;
88c283
@@ -291,7 +292,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
 
88c283
@@ -312,6 +313,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
-- 
88c283
2.21.0
776610