[xorg-x11-drv-synaptics] Ignore MT devices without x/y (#1196975)

Peter Hutterer whot at fedoraproject.org
Tue Mar 24 05:50:15 UTC 2015


commit f20f0abf7f8a4823fe3bc1e6dcba68299bc90da9
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Mar 24 15:48:56 2015 +1000

    Ignore MT devices without x/y (#1196975)

 ...entcomm-ignore-fake-and-broken-MT-devices.patch | 35 ++++++++++++++++++++++
 xorg-x11-drv-synaptics.spec                        |  6 +++-
 2 files changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/0001-eventcomm-ignore-fake-and-broken-MT-devices.patch b/0001-eventcomm-ignore-fake-and-broken-MT-devices.patch
new file mode 100644
index 0000000..fa54d63
--- /dev/null
+++ b/0001-eventcomm-ignore-fake-and-broken-MT-devices.patch
@@ -0,0 +1,35 @@
+From 277151f3b57aebe23e8c5cedb5aec2fceceb9c31 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Tue, 24 Mar 2015 15:41:39 +1000
+Subject: [PATCH synaptics] eventcomm: ignore fake and broken MT devices
+
+An MT device without X/Y is not a touchpad. And neither are fake MT devices.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ src/eventcomm.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/eventcomm.c b/src/eventcomm.c
+index 9e81b86..516dab3 100644
+--- a/src/eventcomm.c
++++ b/src/eventcomm.c
+@@ -320,6 +320,15 @@ event_query_is_touchpad(struct libevdev *evdev, BOOL test_grab)
+         libevdev_has_event_code(evdev, EV_ABS, BTN_TOOL_PEN)) /* Don't match wacom tablets */
+         goto unwind;
+ 
++    if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_SLOT)) {
++        if (libevdev_get_num_slots(evdev) == -1)
++            goto unwind; /* Ignore fake MT devices */
++
++        if (!libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_X) ||
++            !libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_Y))
++            goto unwind;
++    }
++
+     ret = TRUE;
+ 
+  unwind:
+-- 
+2.3.2
+
diff --git a/xorg-x11-drv-synaptics.spec b/xorg-x11-drv-synaptics.spec
index 23c5dc3..16431c5 100644
--- a/xorg-x11-drv-synaptics.spec
+++ b/xorg-x11-drv-synaptics.spec
@@ -8,7 +8,7 @@
 Name:           xorg-x11-drv-synaptics
 Summary:        Xorg X11 Synaptics touchpad input driver
 Version:        1.8.1
-Release:        5%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
+Release:        6%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
 URL:            http://www.x.org
 License:        MIT
 Group:          User Interface/X Hardware Support
@@ -25,6 +25,7 @@ Source4:        70-touchpad-quirks.rules
 
 Patch01:        0001-Support-the-new-Lenovo-X1-Carbon-3rd-trackpoint-butt.patch
 Patch02:        0001-Limit-the-movement-to-20-mm-per-event.patch
+Patch03:        0001-eventcomm-ignore-fake-and-broken-MT-devices.patch
 
 ExcludeArch:    s390 s390x
 
@@ -149,6 +150,9 @@ Development files for the Synaptics TouchPad for X.Org.
 %{_includedir}/xorg/synaptics-properties.h
 
 %changelog
+* Tue Mar 24 2015 Peter Hutterer <peter.hutterer at redhat.com> 1.8.1-6
+- Ignore MT devices without x/y (#1196975)
+
 * Sat Feb 21 2015 Till Maas <opensource at till.name> - 1.8.1-5
 - Rebuilt for Fedora 23 Change
   https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code


More information about the scm-commits mailing list