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

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