From 537f62ba883c7782485bcab48fffafa5057413cb Mon Sep 17 00:00:00 2001 From: matthieu Date: Sun, 22 Jan 2017 09:54:53 +0000 Subject: [PATCH] Update to xf86-input-synaptics 1.9.0 --- driver/xf86-input-synaptics/ChangeLog | 515 ++++++++++++++---- .../{50-synaptics.conf => 70-synaptics.conf} | 0 driver/xf86-input-synaptics/conf/Makefile.am | 2 +- driver/xf86-input-synaptics/conf/Makefile.in | 4 +- driver/xf86-input-synaptics/config.h.in | 3 + driver/xf86-input-synaptics/configure | 65 ++- driver/xf86-input-synaptics/configure.ac | 9 +- .../include/synaptics-properties.h | 2 +- driver/xf86-input-synaptics/man/synaptics.man | 5 +- driver/xf86-input-synaptics/src/eventcomm.c | 130 +++-- driver/xf86-input-synaptics/src/properties.c | 1 + driver/xf86-input-synaptics/src/ps2comm.c | 3 + driver/xf86-input-synaptics/src/synaptics.c | 183 ++----- .../xf86-input-synaptics/src/synapticsstr.h | 8 +- driver/xf86-input-synaptics/src/synproto.h | 1 - driver/xf86-input-synaptics/tools/synclient.c | 1 - driver/xf86-input-synaptics/tools/syndaemon.c | 50 +- 17 files changed, 669 insertions(+), 313 deletions(-) rename driver/xf86-input-synaptics/conf/{50-synaptics.conf => 70-synaptics.conf} (100%) diff --git a/driver/xf86-input-synaptics/ChangeLog b/driver/xf86-input-synaptics/ChangeLog index 7903df40f..6e41c7341 100644 --- a/driver/xf86-input-synaptics/ChangeLog +++ b/driver/xf86-input-synaptics/ChangeLog @@ -1,31 +1,149 @@ -commit af7d8a15278a968d919bf539628281bf713f747b +commit 3261e07c923c449f08a96a8439c97479b7ff899c Author: Peter Hutterer -Date: Thu Oct 29 12:10:09 2015 +1000 +Date: Fri Nov 18 13:00:09 2016 +1000 - synaptics 1.8.3 + synaptics 1.9.0 Signed-off-by: Peter Hutterer -commit 3e7508ac087028f8f8e116f5279dad1ebcdc58e6 -Author: Gabriele Mazzotta -Date: Thu Aug 14 20:03:42 2014 +0200 - - Use cumulative relative touch movements while scrolling - - Signed-off-by: Gabriele Mazzotta - Reviewed-by: Peter Hutterer - Signed-off-by: Peter Hutterer - (cherry picked from commit ec0901e5f81d9cad6cc8bbdcb5ea075009c13de5) - -commit 6f8d4bac14ac8f3fd2714f0a8a9e37c5136a4013 +commit a7d76f4275a88d98b18eed29a1ee94a70e7fa367 Author: Peter Hutterer -Date: Fri Mar 27 11:26:55 2015 +1000 +Date: Sun Oct 9 19:27:47 2016 +1000 - synaptics 1.8.2 + synaptics 1.8.99.2 Signed-off-by: Peter Hutterer -commit 15caf2b53407379f8e677d48a022f4b46b97d83a +commit 35b9472a189c88415fed137fb4c62a5081caaea5 +Author: Peter Hutterer +Date: Thu Sep 15 13:47:09 2016 +1000 + + Remove unused fraction calculations + + hw.x and the motion history are integers so our deltas are always integers. + It's a bit pointless to split them into the fractional and integral part. + + obsolete since defc1d008e5674306a or so + + Signed-off-by: Peter Hutterer + +commit 486322116d70365c2e2a1d9f45830057fa03153e +Author: Peter Hutterer +Date: Wed Aug 17 11:32:12 2016 +1000 + + eventcomm: don't ever probe if a device is set + + If opening the fd fails we still need to fail the device. This is particularly + the case when a device disappears before we can open it - the current code + wouldn't exit but instead switch to auto-probe touchpad devices on the system. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit cd9f9799235aefff1ec1a0af9ec6b45969119659 +Author: Anton Lindqvist +Date: Fri Aug 5 10:21:59 2016 +0200 + + syndaemon: enable touchpad when pressing a modifier combo + + When ignoring modifiers, ensure the touchpad is enabled once a modifier + key is pressed disregarding any previous key press that caused the + touchpad to be disabled. + + Signed-off-by: Anton Lindqvist + Signed-off-by: Peter Hutterer + +commit 248c5936a0151d0766a95457330c7d3ef9335b94 +Author: Peter Hutterer +Date: Thu Jun 2 10:05:02 2016 +1000 + + Support XINPUT ABI version 23 + + Use input_lock/input_unlock calls instead of SIGIO functions + + Signed-off-by: Peter Hutterer + +commit 59e5db025307404fbfbc82f2fb3fe91d6a3005d7 +Author: Stefan Dirsch +Date: Thu May 19 17:35:57 2016 +0200 + + conf: rename to 70-synaptics.conf + + Bump up the synaptics driver to 70, so it get's preferred over libinput, which + was dropped down to 60. The synaptics driver is more of a leaf package + than libinput (which covers a multitude of device types) and can be removed by + default. When specifically installed by the user, the synaptics driver should + override the system default. + + Similar to what was done for wacom configuration file. + + https://bugzilla.suse.com/show_bug.cgi?id=979554 + + Signed-off-by: Stefan Dirsch + Signed-off-by: Peter Hutterer + +commit 979fbec84197cd2c8ea3ffdd8e7726e8a617328b +Author: Peter Hutterer +Date: Fri Apr 29 10:51:17 2016 +1000 + + Revert MaxDoubleTapTime back to 180 + + Fallout from 90c6d7fc60f3db1bd9db1c7702062fcaef3b3352 where it got changed to + 100ms. This is too short for triple-tap-and-drag gestures so revert it to the + previous value. + + https://bugs.freedesktop.org/show_bug.cgi?id=95171 + + Signed-off-by: Peter Hutterer + +commit 2a1a17244f067b2ae893ea01d737e135586b151c +Author: Peter Hutterer +Date: Fri Apr 29 08:48:19 2016 +1000 + + synaptics 1.8.99.1 + + Signed-off-by: Peter Hutterer + +commit f1f58fffbf482de74bc7907e0af69feb9fe88a45 +Author: Peter Hutterer +Date: Wed Apr 27 09:29:27 2016 +1000 + + eventcomm: fix typo checking for two-finger scrolling + + Signed-off-by: Peter Hutterer + +commit 0a4cf80a00663ff3ce8e76baf0940782576efe13 +Author: Peter Hutterer +Date: Thu Mar 26 16:28:56 2015 +1000 + + Drop touch events from the driver + + This was a bad idea. No-one seems to use this and it gives us little benefits. + To even get this feature a number of other features need to be turned off + (like two-finger scrolling and tapping). Many of these are enabled by default, + if they are disabled a client stack with full touchpad gesture support could + in theory support true touchpad gestures. This has never happened. + + Drop the touch events from the synaptics driver. This allows us to switch the + touchpad fully over to look like a relative device, thus also removing the + bug that changes the touchpad speed whenever a monitor is added/removed in. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 7aa327603fb2a8af58c8df6f4a4dd46e8294050e +Author: Peter Hutterer +Date: Wed Jun 17 15:31:08 2015 +1000 + + eventcomm: ignore key repeat events + + Usually doesn't happen, but the evtest output in + https://bugs.freedesktop.org/show_bug.cgi?id=90392 + actually has repeat events for the button. Ignore them if they happen. + + Signed-off-by: Peter Hutterer + +commit fc9f490a2c87e6f87b0f483cd6bf5f526dddbb8d Author: Peter Hutterer Date: Tue Mar 24 15:41:39 2015 +1000 @@ -35,9 +153,8 @@ Date: Tue Mar 24 15:41:39 2015 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede - (cherry picked from commit fc9f490a2c87e6f87b0f483cd6bf5f526dddbb8d) -commit ef8daaf696584f7c1d3e9f192de18b5b9f923bdc +commit 30866b97be6939b895327b930154ef758eed7ff8 Author: Peter Hutterer Date: Mon Mar 23 11:38:15 2015 +1000 @@ -49,9 +166,47 @@ Date: Mon Mar 23 11:38:15 2015 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede - (cherry picked from commit 30866b97be6939b895327b930154ef758eed7ff8) -commit 90c6d7fc60f3db1bd9db1c7702062fcaef3b3352 +commit 5378a020a003cbdfa565d43c9e01997b570059c9 +Author: Peter Hutterer +Date: Tue Mar 17 16:06:41 2015 +1000 + + Revert "Support the new Lenovo X1 Carbon 3rd trackpoint buttons" + + This reverts commit 064445364b4775b25ba49c2250b22b169f291147. + + The Lenovo *50 series, including the X1 Carbon 3rd always require multiple + kernel patches to enable the touchpad buttons. This patch in synaptics only + addresses the re-routing of the top buttons. + + The final iteration of the kernel patches also route the trackpoint buttons + through the trackpoint device, rendering this patch unnecessary. These patches + are queued for 4.0. + + See kernel patch series up to commit cdd9dc195916ef5644cfac079094c3c1d1616e4c + Author: Benjamin Tissoires + Date: Sun Mar 8 22:35:41 2015 -0700 + + Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series + + Currently in Dmitry's for-linus branch. + + Distributions running older kernels or the kernel stable series which has + partial backports of the above patch series are encouraged to leave the + 0644453 commit in and undo this revert. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 00db769067fa0703f96284bd50ea384efd47e2de +Author: Peter Hutterer +Date: Fri Mar 6 11:06:41 2015 +1000 + + conf: add Lenovo T450s and W451 to rules + + Signed-off-by: Peter Hutterer + +commit 37d34f0356cc556dd8a49ec5d1ed64d49417a9b2 Author: Gabriele Mazzotta Date: Thu Jan 15 22:04:17 2015 +0100 @@ -70,9 +225,38 @@ Date: Thu Jan 15 22:04:17 2015 +0100 Signed-off-by: Gabriele Mazzotta Signed-off-by: Peter Hutterer - (cherry picked from commit 37d34f0356cc556dd8a49ec5d1ed64d49417a9b2) -commit 649b77f0ce617fd1ec073b281636e304e80b56c0 +commit 064445364b4775b25ba49c2250b22b169f291147 +Author: Peter Hutterer +Date: Thu Jan 29 11:25:26 2015 +1000 + + Support the new Lenovo X1 Carbon 3rd trackpoint buttons + + This device has the trackpoint buttons wired up to the touchpad to send BTN_0, + BTN_1 and BTN_2 for left, right, middle. This conflicts with previous + touchpads that used those event codes for dedicated scroll buttons. + + Add an option HasTrackpointButtons that can be set via a xorg.conf.d + snippets. This option is not intended as a user-set option, rather + we expect distributions to ship some conglomerate of udev/hal rules with + xorg.conf snippets that take effect. + + If the option is set, we look at the three affected buttons at the beginning + of HandleState and send button events immediately for them. The HW state is + reset to neutral and other processing continues. This saves us from having to + synchronize these buttons with software buttons (also present on this device), + tapping, etc. + + Since the buttons are physically different and (mentally) associated with the + trackpoint device we also don't need to worry about having finger motion event + correctly synced up with the button presses - it's acceptable to send the + presses before the motion events. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + Tested-by: Benjamin Tissoires + +commit a357647d3fb918b94efbda98138fb0240a949ef2 Author: Gabriele Mazzotta Date: Thu Jan 15 22:04:16 2015 +0100 @@ -82,17 +266,81 @@ Date: Thu Jan 15 22:04:16 2015 +0100 Signed-off-by: Gabriele Mazzotta Signed-off-by: Peter Hutterer - (cherry picked from commit a357647d3fb918b94efbda98138fb0240a949ef2) -commit d50c4bab8ae2836a0f38b29a5d22be2e950e4d08 -Author: Peter Hutterer -Date: Thu Sep 18 07:40:13 2014 +1000 +commit 383355fa5f536205759f10efa99eaec4e5089376 +Author: Gabriele Mazzotta +Date: Fri Jan 9 17:01:42 2015 +0100 - synaptics 1.8.1 + Remove FastTap leftovers + FastTap was removed with d14ea867ad5d ("Purge fast-taps option"), + remove all of what remained. + + Signed-off-by: Gabriele Mazzotta Signed-off-by: Peter Hutterer -commit bdf6a6b2e2603142e62ae5968c65e6e26f57e51d +commit a05894d169be42f03d21fb8287da902d8c24c566 +Author: Gabriele Mazzotta +Date: Wed Jan 7 14:12:33 2015 +0100 + + Don't assume that touch devices report per finger width and pressure + + The palm detection relies on both the width and the pressure. + a897147be04 ("Use ABS_MT events for the palm detection when supported") + assumed that all the touch devices can report both ABS_MT_TOUCH_MAJOR + and ABS_MT_PRESSURE, but this is not necessarily true. This assumption + could hence break the palm detection when at least one of the mentioned + events is not declared but both ABS_TOOL_WIDTH and ABS_PRESSURE are + reported. + + Signed-off-by: Gabriele Mazzotta + Signed-off-by: Peter Hutterer + +commit a897147be04d74ed452cda166fd4e01f9615ff72 +Author: Gabriele Mazzotta +Date: Tue Sep 16 17:20:15 2014 +0200 + + Use ABS_MT events for the palm detection when supported + + Use ABS_MT_TOUCH_MAJOR and ABS_MT_PRESSURE instead of ABS_TOOL_WIDTH + and ABS_PRESSURE when supported so that the pressure and the width of + all the fingers is taken into account for the palm detection. + + This also fixes the palm detection for those touchpads for which the + kernel only sends ABS_MT_TOUCH_MAJOR and not ABS_TOOL_WIDTH. + + Signed-off-by: Gabriele Mazzotta + Signed-off-by: Peter Hutterer + +commit 41b2312c006fca1f24e1a366174d3203a63fa04a +Author: Peter Hutterer +Date: Tue Sep 16 08:52:56 2014 +1000 + + Limit the movement to 20 mm per event + + Touchpads are limited by a fixed sampling rate (usually 80Hz). Some finger + changes may happen too fast for this sampling rate, resulting in two distinct + event sequences: + * finger 1 up and finger 2 down in the same EV_SYN frame. Synaptics sees one + finger down before and after and the changed coordinates + * finger 1 up and finger 2 down _between_ two EV_SYN frames. Synaptics sees one + touchpoint move from f1 position to f2 position. + + That move causes a large cursor jump. The former could be solved (with + difficulty) by adding fake EV_SYN handling after releasing touchpoints but + that won't fix the latter case. + + So as a solution for now limit the finger movement to 20mm per event. + Tests on a T440 and an x220 showed that this is just above what a reasonable + finger movement would trigger. If a movement is greater than that limit, reset + it to 0/0. + + On devices without resolution, use 0.25 of the touchpad's diagonal instead. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede + +commit 049611bd7f04e285909c55807478306cce83385f Author: Peter Hutterer Date: Tue Sep 16 10:44:40 2014 +1000 @@ -102,9 +350,8 @@ Date: Tue Sep 16 10:44:40 2014 +1000 just general weirdness. Signed-off-by: Peter Hutterer - (cherry picked from commit 049611bd7f04e285909c55807478306cce83385f) -commit 2dd60417450af4ac4f9938e09b06707dd91bddfb +commit afbbcfa10eb3a2295823720907f35bb59972dd82 Author: Peter Hutterer Date: Fri Sep 5 15:14:47 2014 +1000 @@ -116,9 +363,8 @@ Date: Fri Sep 5 15:14:47 2014 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard - (cherry picked from commit afbbcfa10eb3a2295823720907f35bb59972dd82) -commit 9de611219bebd9b101b98bb79cc0173115ee1833 +commit d239f831f17ccf5468f5dc6b2f199a9c1f6e35af Author: Peter Hutterer Date: Fri Sep 5 14:24:29 2014 +1000 @@ -128,9 +374,44 @@ Date: Fri Sep 5 14:24:29 2014 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard - (cherry picked from commit d239f831f17ccf5468f5dc6b2f199a9c1f6e35af) -commit 36d7ee1c9d60752666a94ee4755b3a1d0f339164 +commit 4d3d761799436e80fbcf0d99797eed35e68c90d2 +Author: Peter Hutterer +Date: Fri Sep 5 14:15:46 2014 +1000 + + Shut up a coverity warning + + xf86-input-synaptics-1.8.0/src/synaptics.c:498: var_compare_op: Comparing + "end_str" to null implies that "end_str" might be null. + + end_str can't be null, so no need for this check and no need to get Coverity + all confused. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 536e17c83e565ddba9c7c5a4cd613edf8378e9aa +Author: Peter Hutterer +Date: Fri Sep 5 14:13:08 2014 +1000 + + Mark some switch case fallthroughs with comments + + Just to make it explicit + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit ec0901e5f81d9cad6cc8bbdcb5ea075009c13de5 +Author: Gabriele Mazzotta +Date: Thu Aug 14 20:03:42 2014 +0200 + + Use cumulative relative touch movements while scrolling + + Signed-off-by: Gabriele Mazzotta + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 90d19302306f49722e210227b2fb5161e6f51880 Author: Peter Hutterer Date: Thu Aug 28 14:13:38 2014 +1000 @@ -160,9 +441,8 @@ Date: Thu Aug 28 14:13:38 2014 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede - (cherry picked from commit 90d19302306f49722e210227b2fb5161e6f51880) -commit 475e0d3668097f4deb9448c8765dd12b3f15534f +commit 96e60a4ea242d2decf109835981ae186cc36f642 Author: Peter Hutterer Date: Fri Aug 29 07:57:41 2014 +1000 @@ -181,9 +461,18 @@ Date: Fri Aug 29 07:57:41 2014 +1000 See http://lists.freedesktop.org/archives/xorg-devel/2014-July/043070.html Signed-off-by: Peter Hutterer - (cherry picked from commit 96e60a4ea242d2decf109835981ae186cc36f642) -commit ae77fdfc8e57e612e8aa0e9b45bbea478a82c30b +commit 68d22ecf145bb9073121fd3a9fc1fdd0f880e48b +Author: Peter Hutterer +Date: Thu Aug 28 16:50:18 2014 +1000 + + Silence two compiler warnings + + Potentially uninitialized, false positive in both cases. + + Signed-off-by: Peter Hutterer + +commit 7d0ff39519e4d3760722b914883bee276035061c Author: Gabriele Mazzotta Date: Sun Jul 27 12:58:18 2014 +0200 @@ -198,9 +487,29 @@ Date: Sun Jul 27 12:58:18 2014 +0200 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 7d0ff39519e4d3760722b914883bee276035061c) -commit cbf0ca508a14201d2c25f96dd6f38cea2cb1954b +commit a36edf8307ab9b5bffca103dd875623a66012c0b +Author: Peter Hutterer +Date: Thu May 15 08:34:55 2014 +1000 + + Use libevdev's per-device logging functions instead of the global handler + + Per-device logging functions don't interfere with other drivers if they also + use libevdev, so use those instead the global log handler if available. If not + available, drop libevdev logging, I don't want to maintain the ifdef mess and + the logging doesn't give us _that_ much benefit. + + Signed-off-by: Peter Hutterer + +commit c1457c0f71e30c194180164320759849fa09bf9b +Author: Peter Hutterer +Date: Thu May 29 14:44:43 2014 +1000 + + synaptics 1.8.99 + + Signed-off-by: Peter Hutterer + +commit 730101223432f60397c61f74a5e6789b3ee34ecd Author: Peter Hutterer Date: Wed Aug 6 12:04:14 2014 +1000 @@ -220,7 +529,23 @@ Date: Wed Aug 6 12:04:14 2014 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede - (cherry picked from commit 730101223432f60397c61f74a5e6789b3ee34ecd) + +commit ddd8844a47bfa28974e40fc9aec9b17656415a6c +Author: Peter Hutterer +Date: Mon May 19 08:06:46 2014 +1000 + + eventcomm: Drop requirement for a grab during init + + When we required a grab on the device, this was a shortcut so we didn't have + to query the device only to realise we can't read events off it anyway. Now + that we don't actually grab the device by default, this is unnecessary. + + Something else may have a temporary grab on the device during init, in which + case we just continue as usual and read events if and when they become + available. + + Signed-off-by: Peter Hutterer + Reviewed-by: Hans de Goede commit 3a4cc96590ca0e0ff526a5e5406f29a402bddd1a Author: Peter Hutterer @@ -482,8 +807,8 @@ Date: Wed Mar 12 14:11:29 2014 +1000 This reverts commit eea73358760c7ff9c9dac061f265753637c6f25c. Conflicts: - man/synaptics.man - src/synaptics.c + man/synaptics.man + src/synaptics.c Signed-off-by: Peter Hutterer @@ -609,24 +934,24 @@ Date: Fri Feb 21 10:31:44 2014 +0100 It is possible for a click to get reported before any related touch events get reported, here is the relevant part of an evemu-record session on a T440s: - E: 3.985585 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- - E: 3.997419 0003 0039 -001 # EV_ABS / ABS_MT_TRACKING_ID -1 - E: 3.997419 0001 014a 0000 # EV_KEY / BTN_TOUCH 0 - E: 3.997419 0003 0018 0000 # EV_ABS / ABS_PRESSURE 0 - E: 3.997419 0001 0145 0000 # EV_KEY / BTN_TOOL_FINGER 0 - E: 3.997419 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- - E: 5.117881 0001 0110 0001 # EV_KEY / BTN_LEFT 1 - E: 5.117881 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- - E: 5.133422 0003 0039 0187 # EV_ABS / ABS_MT_TRACKING_ID 187 - E: 5.133422 0003 0035 3098 # EV_ABS / ABS_MT_POSITION_X 3098 - E: 5.133422 0003 0036 3282 # EV_ABS / ABS_MT_POSITION_Y 3282 - E: 5.133422 0003 003a 0046 # EV_ABS / ABS_MT_PRESSURE 46 - E: 5.133422 0001 014a 0001 # EV_KEY / BTN_TOUCH 1 - E: 5.133422 0003 0000 3102 # EV_ABS / ABS_X 3102 - E: 5.133422 0003 0001 3282 # EV_ABS / ABS_Y 3282 - E: 5.133422 0003 0018 0046 # EV_ABS / ABS_PRESSURE 46 - E: 5.133422 0001 0145 0001 # EV_KEY / BTN_TOOL_FINGER 1 - E: 5.133422 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- + E: 3.985585 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- + E: 3.997419 0003 0039 -001 # EV_ABS / ABS_MT_TRACKING_ID -1 + E: 3.997419 0001 014a 0000 # EV_KEY / BTN_TOUCH 0 + E: 3.997419 0003 0018 0000 # EV_ABS / ABS_PRESSURE 0 + E: 3.997419 0001 0145 0000 # EV_KEY / BTN_TOOL_FINGER 0 + E: 3.997419 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- + E: 5.117881 0001 0110 0001 # EV_KEY / BTN_LEFT 1 + E: 5.117881 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- + E: 5.133422 0003 0039 0187 # EV_ABS / ABS_MT_TRACKING_ID 187 + E: 5.133422 0003 0035 3098 # EV_ABS / ABS_MT_POSITION_X 3098 + E: 5.133422 0003 0036 3282 # EV_ABS / ABS_MT_POSITION_Y 3282 + E: 5.133422 0003 003a 0046 # EV_ABS / ABS_MT_PRESSURE 46 + E: 5.133422 0001 014a 0001 # EV_KEY / BTN_TOUCH 1 + E: 5.133422 0003 0000 3102 # EV_ABS / ABS_X 3102 + E: 5.133422 0003 0001 3282 # EV_ABS / ABS_Y 3282 + E: 5.133422 0003 0018 0046 # EV_ABS / ABS_PRESSURE 46 + E: 5.133422 0001 0145 0001 # EV_KEY / BTN_TOOL_FINGER 1 + E: 5.133422 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- Notice the BTN_LEFT event all by itself! @@ -876,8 +1201,8 @@ Date: Thu Feb 13 14:55:12 2014 +1000 Signed-off-by: Peter Hutterer Conflicts: - man/synaptics.man - src/synaptics.c + man/synaptics.man + src/synaptics.c Acked-by: Daniel Stone @@ -906,9 +1231,9 @@ Date: Fri Jan 17 08:24:35 2014 +1000 Lifebook E782 and others in the series. Conflicts: - include/synaptics.h - man/synaptics.man - src/synaptics.c + include/synaptics.h + man/synaptics.man + src/synaptics.c commit 48fbf44a3903bc6975add21be35586914a53c310 Author: Peter Hutterer @@ -3013,7 +3338,7 @@ Date: Tue Feb 7 13:07:07 2012 -0800 Conflicts: - src/synaptics.c + src/synaptics.c Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer @@ -4693,7 +5018,7 @@ Date: Mon Feb 21 11:55:17 2011 +1000 Conflicts: - src/synaptics.c + src/synaptics.c Signed-off-by: Peter Hutterer @@ -4723,7 +5048,7 @@ Date: Mon Feb 21 11:47:46 2011 +1000 Merge branch 'devel' into merge Conflicts: - src/synaptics.c + src/synaptics.c commit cc26edfba13216ceda02d9d352643535ba359e5e Author: Simon Thum @@ -5098,7 +5423,7 @@ Date: Wed Sep 1 13:42:37 2010 +1000 Merge branch 'input-api' Conflicts: - src/properties.c + src/properties.c commit 81ad2e389d11691d5c2687d83150e8e9033cfe76 Author: Peter Hutterer @@ -5735,7 +6060,7 @@ Date: Tue May 25 13:00:04 2010 -0400 config: unconditionaly build synclient and syndaemon apps The current conditional building of the apps was introduced by - commit 080caee95c46bb471d1442dcab246460cad8c7be due to optional + commit 080caee95c46bb471d1442dcab246460cad8c7be due to optional support properties. This is no longer an issue. There are no longer any reason not to build these bona fide apps. @@ -5893,25 +6218,25 @@ Date: Sun May 30 21:19:29 2010 -0400 Permutations of --enable-tools and dependencies: - build_tools libXi installed Result - ----------- --------------- --------- - yes yes build tools + build_tools libXi installed Result + ----------- --------------- --------- + yes yes build tools auto yes build tools - no yes skip build - yes no abort configuration - auto no warn and skip build - no no warn and skip build + no yes skip build + yes no abort configuration + auto no warn and skip build + no no warn and skip build Permutations of libXtst, record.h and recordproto - libXtst record.h recordproto syndaemon - installed installed installed using XRecord? + libXtst record.h recordproto syndaemon + installed installed installed using XRecord? - yes yes yes yes - yes no yes no - no no yes no - no yes yes no - no no no no + yes yes yes yes + yes no yes no + no no yes no + no yes yes no + no no no no Other scenarios are possible where you have 2 different versions of record.h installed in different $prefix locations. The order @@ -6453,7 +6778,7 @@ Date: Sat Sep 12 09:52:50 2009 +0200 functionality when using automake 1.11. Conflicts: - configure.ac + configure.ac commit e01129440742f39650a50c193315b2824c0b303a Author: Peter Hutterer @@ -6591,7 +6916,7 @@ Date: Wed Jul 22 10:41:08 2009 +1000 Conflicts: - src/synaptics.c + src/synaptics.c Signed-off-by: Peter Hutterer @@ -8253,10 +8578,10 @@ Date: Wed Aug 6 21:40:11 2008 +0200 This adds 3 new options. Use them as follows: Section "InputDevice" - ... - Option "ClickFinger1" "1" - Option "ClickFinger2" "3" - Option "ClickFinger3" "2" + ... + Option "ClickFinger1" "1" + Option "ClickFinger2" "3" + Option "ClickFinger3" "2" EndSection The driver would then report: @@ -8502,8 +8827,8 @@ Date: Fri Jun 6 21:56:59 2008 +0200 Conflicts: - linux_input.h - src/synaptics.c + linux_input.h + src/synaptics.c Drop the changes from Matthew Garrett since he did not agree to the MIT license change. diff --git a/driver/xf86-input-synaptics/conf/50-synaptics.conf b/driver/xf86-input-synaptics/conf/70-synaptics.conf similarity index 100% rename from driver/xf86-input-synaptics/conf/50-synaptics.conf rename to driver/xf86-input-synaptics/conf/70-synaptics.conf diff --git a/driver/xf86-input-synaptics/conf/Makefile.am b/driver/xf86-input-synaptics/conf/Makefile.am index 38d2a011b..b883c10d5 100644 --- a/driver/xf86-input-synaptics/conf/Makefile.am +++ b/driver/xf86-input-synaptics/conf/Makefile.am @@ -20,7 +20,7 @@ if HAS_XORG_CONF_DIR -dist_config_DATA = 50-synaptics.conf +dist_config_DATA = 70-synaptics.conf else fdidir = $(datadir)/hal/fdi/policy/20thirdparty dist_fdi_DATA = 11-x11-synaptics.fdi diff --git a/driver/xf86-input-synaptics/conf/Makefile.in b/driver/xf86-input-synaptics/conf/Makefile.in index 23df77aee..a178fd131 100644 --- a/driver/xf86-input-synaptics/conf/Makefile.in +++ b/driver/xf86-input-synaptics/conf/Makefile.in @@ -100,7 +100,7 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__dist_config_DATA_DIST = 50-synaptics.conf +am__dist_config_DATA_DIST = 70-synaptics.conf am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -281,7 +281,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@HAS_XORG_CONF_DIR_TRUE@dist_config_DATA = 50-synaptics.conf +@HAS_XORG_CONF_DIR_TRUE@dist_config_DATA = 70-synaptics.conf @HAS_XORG_CONF_DIR_FALSE@fdidir = $(datadir)/hal/fdi/policy/20thirdparty @HAS_XORG_CONF_DIR_FALSE@dist_fdi_DATA = 11-x11-synaptics.fdi all: all-am diff --git a/driver/xf86-input-synaptics/config.h.in b/driver/xf86-input-synaptics/config.h.in index 321b6176e..eee2cdf51 100644 --- a/driver/xf86-input-synaptics/config.h.in +++ b/driver/xf86-input-synaptics/config.h.in @@ -21,6 +21,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* libevdev supports per-device log functions */ +#undef HAVE_LIBEVDEV_DEVICE_LOG_FUNCS + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM diff --git a/driver/xf86-input-synaptics/configure b/driver/xf86-input-synaptics/configure index 57ea014d6..d8e25976e 100755 --- a/driver/xf86-input-synaptics/configure +++ b/driver/xf86-input-synaptics/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xf86-input-synaptics 1.8.3. +# Generated by GNU Autoconf 2.69 for xf86-input-synaptics 1.9.0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xf86-input-synaptics' PACKAGE_TARNAME='xf86-input-synaptics' -PACKAGE_VERSION='1.8.3' -PACKAGE_STRING='xf86-input-synaptics 1.8.3' +PACKAGE_VERSION='1.9.0' +PACKAGE_STRING='xf86-input-synaptics 1.9.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -1382,7 +1382,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-input-synaptics 1.8.3 to adapt to many kinds of systems. +\`configure' configures xf86-input-synaptics 1.9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1453,7 +1453,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-input-synaptics 1.8.3:";; + short | recursive ) echo "Configuration of xf86-input-synaptics 1.9.0:";; esac cat <<\_ACEOF @@ -1593,7 +1593,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-input-synaptics configure 1.8.3 +xf86-input-synaptics configure 1.9.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1917,7 +1917,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-input-synaptics $as_me 1.8.3, which was +It was created by xf86-input-synaptics $as_me 1.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2746,7 +2746,7 @@ fi # Define the identity of the package. PACKAGE='xf86-input-synaptics' - VERSION='1.8.3' + VERSION='1.9.0' cat >>confdefs.h <<_ACEOF @@ -18041,6 +18041,51 @@ else $as_echo "yes" >&6; } fi + SAVE_LIBS="$LIBS" + LIBS="$LIBEVDEV_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libevdev_set_device_log_function in -levdev" >&5 +$as_echo_n "checking for libevdev_set_device_log_function in -levdev... " >&6; } +if ${ac_cv_lib_evdev_libevdev_set_device_log_function+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-levdev $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char libevdev_set_device_log_function (); +int +main () +{ +return libevdev_set_device_log_function (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_evdev_libevdev_set_device_log_function=yes +else + ac_cv_lib_evdev_libevdev_set_device_log_function=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_evdev_libevdev_set_device_log_function" >&5 +$as_echo "$ac_cv_lib_evdev_libevdev_set_device_log_function" >&6; } +if test "x$ac_cv_lib_evdev_libevdev_set_device_log_function" = xyes; then : + +$as_echo "#define HAVE_LIBEVDEV_DEVICE_LOG_FUNCS 1" >>confdefs.h + +fi + + LIBS="$SAVE_LIBS" fi if test "x$BUILD_PSMCOMM" = xyes; then @@ -18854,7 +18899,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-input-synaptics $as_me 1.8.3, which was +This file was extended by xf86-input-synaptics $as_me 1.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18920,7 +18965,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xf86-input-synaptics config.status 1.8.3 +xf86-input-synaptics config.status 1.9.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/driver/xf86-input-synaptics/configure.ac b/driver/xf86-input-synaptics/configure.ac index ee83506ea..4bd4ae1ca 100644 --- a/driver/xf86-input-synaptics/configure.ac +++ b/driver/xf86-input-synaptics/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-input-synaptics], - [1.8.3], + [1.9.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-input-synaptics]) AC_CONFIG_SRCDIR([Makefile.am]) @@ -121,6 +121,13 @@ esac if test "x$BUILD_EVENTCOMM" = xyes; then AC_DEFINE(BUILD_EVENTCOMM, 1, [Optional backend eventcomm enabled]) PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4]) + SAVE_LIBS="$LIBS" + LIBS="$LIBEVDEV_LIBS" + AC_CHECK_LIB(evdev, libevdev_set_device_log_function, + [AC_DEFINE(HAVE_LIBEVDEV_DEVICE_LOG_FUNCS, 1, + [libevdev supports per-device log functions])], + []) + LIBS="$SAVE_LIBS" fi if test "x$BUILD_PSMCOMM" = xyes; then AC_DEFINE(BUILD_PSMCOMM, 1, [Optional backend psmcomm enabled]) diff --git a/driver/xf86-input-synaptics/include/synaptics-properties.h b/driver/xf86-input-synaptics/include/synaptics-properties.h index 32ab2e1f0..0f79b64c1 100644 --- a/driver/xf86-input-synaptics/include/synaptics-properties.h +++ b/driver/xf86-input-synaptics/include/synaptics-properties.h @@ -51,7 +51,7 @@ /* 8 bit (BOOL) */ #define SYNAPTICS_PROP_CLICKPAD "Synaptics ClickPad" -/* 8 bit (BOOL) */ +/* 8 bit (BOOL), */ #define SYNAPTICS_PROP_TAP_FAST "Synaptics Tap FastTap" /* 32 bit */ diff --git a/driver/xf86-input-synaptics/man/synaptics.man b/driver/xf86-input-synaptics/man/synaptics.man index 76756be55..4f87b01fe 100644 --- a/driver/xf86-input-synaptics/man/synaptics.man +++ b/driver/xf86-input-synaptics/man/synaptics.man @@ -591,7 +591,6 @@ A too long value can cause undesirable autorepeat in scroll bars and a too small value means that visual feedback from the gui application you are interacting with is harder to see. . -For this parameter to have any effect, "FastTaps" has to be disabled. .SS Acceleration The MinSpeed, MaxSpeed and AccelFactor parameters control the pointer motion speed. @@ -924,7 +923,7 @@ Configuration through .I InputClass sections is recommended in X servers 1.8 and later. See xorg.conf.d(5) for more details. An example xorg.conf.d snippet is provided in -.I ${sourcecode}/conf/50-synaptics.conf +.I ${sourcecode}/conf/70-synaptics.conf .LP Configuration through hal fdi files is recommended in X servers 1.5, 1.6 and 1.7. An example hal policy file is provided in @@ -967,8 +966,6 @@ The following options are no longer part of the driver configuration: .TP .BI "Option \*qTrackstickSpeed\*q \*q" float \*q .TP -.BI "Option \*qFastTaps\*q \*q" boolean \*q -.TP .BI "Option \*qEdgeMotionMinZ\*q \*q" integer \*q .TP .BI "Option \*qEdgeMotionMaxZ\*q \*q" integer \*q diff --git a/driver/xf86-input-synaptics/src/eventcomm.c b/driver/xf86-input-synaptics/src/eventcomm.c index 635ec2c40..f65d53200 100644 --- a/driver/xf86-input-synaptics/src/eventcomm.c +++ b/driver/xf86-input-synaptics/src/eventcomm.c @@ -93,15 +93,18 @@ struct eventcomm_proto_data { int have_monotonic_clock; }; +#ifdef HAVE_LIBEVDEV_DEVICE_LOG_FUNCS static void -libevdev_log_func(enum libevdev_log_priority priority, +libevdev_log_func(const struct libevdev *dev, + enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) -_X_ATTRIBUTE_PRINTF(6, 0); +_X_ATTRIBUTE_PRINTF(7, 0); static void -libevdev_log_func(enum libevdev_log_priority priority, +libevdev_log_func(const struct libevdev *dev, + enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) @@ -111,19 +114,15 @@ libevdev_log_func(enum libevdev_log_priority priority, switch(priority) { case LIBEVDEV_LOG_ERROR: verbosity = 0; break; case LIBEVDEV_LOG_INFO: verbosity = 4; break; - case LIBEVDEV_LOG_DEBUG: verbosity = 10; break; + case LIBEVDEV_LOG_DEBUG: + default: + verbosity = 10; + break; } LogVMessageVerbSigSafe(X_NOTICE, verbosity, format, args); } - -static void -set_libevdev_log_handler(void) -{ - /* be quiet, gcc *handwave* */ - libevdev_set_log_function((libevdev_log_func_t)libevdev_log_func, NULL); - libevdev_set_log_priority(LIBEVDEV_LOG_DEBUG); -} +#endif struct eventcomm_proto_data * EventProtoDataAlloc(int fd) @@ -131,7 +130,6 @@ EventProtoDataAlloc(int fd) struct eventcomm_proto_data *proto_data; int rc; - set_libevdev_log_handler(); proto_data = calloc(1, sizeof(struct eventcomm_proto_data)); if (!proto_data) @@ -140,12 +138,31 @@ EventProtoDataAlloc(int fd) proto_data->st_to_mt_scale[0] = 1; proto_data->st_to_mt_scale[1] = 1; - rc = libevdev_new_from_fd(fd, &proto_data->evdev); + proto_data->evdev = libevdev_new(); + if (!proto_data->evdev) { + rc = -1; + goto out; + } + +#ifdef HAVE_LIBEVDEV_DEVICE_LOG_FUNCS + libevdev_set_device_log_function(proto_data->evdev, libevdev_log_func, + LIBEVDEV_LOG_DEBUG, NULL); +#endif + + rc = libevdev_set_fd(proto_data->evdev, fd); if (rc < 0) { + goto out; + } + + proto_data->read_flag = LIBEVDEV_READ_FLAG_NORMAL; + +out: + if (rc < 0) { + if (proto_data && proto_data->evdev) + libevdev_free(proto_data->evdev); free(proto_data); proto_data = NULL; - } else - proto_data->read_flag = LIBEVDEV_READ_FLAG_NORMAL; + } return proto_data; } @@ -222,8 +239,6 @@ EventDeviceOnHook(InputInfoPtr pInfo, SynapticsParameters * para) (struct eventcomm_proto_data *) priv->proto_data; int ret; - set_libevdev_log_handler(); - if (libevdev_get_fd(proto_data->evdev) != -1) { struct input_event ev; @@ -284,58 +299,42 @@ EventDeviceOffHook(InputInfoPtr pInfo) * - BTN_TOOL_PEN is _not_ set * * @param evdev Libevdev handle - * @param test_grab If true, test whether an EVIOCGRAB is possible on the - * device. A failure to grab the event device returns in a failure. * * @return TRUE if the device is a touchpad or FALSE otherwise. */ static Bool -event_query_is_touchpad(struct libevdev *evdev, BOOL test_grab) +event_query_is_touchpad(struct libevdev *evdev) { - int ret = FALSE, rc; - - if (test_grab) { - rc = libevdev_grab(evdev, LIBEVDEV_GRAB); - if (rc < 0) - return FALSE; - } - /* Check for ABS_X, ABS_Y, ABS_PRESSURE and BTN_TOOL_FINGER */ if (!libevdev_has_event_type(evdev, EV_SYN) || !libevdev_has_event_type(evdev, EV_ABS) || !libevdev_has_event_type(evdev, EV_KEY)) - goto unwind; + return FALSE; if (!libevdev_has_event_code(evdev, EV_ABS, ABS_X) || !libevdev_has_event_code(evdev, EV_ABS, ABS_Y)) - goto unwind; + return FALSE; /* we expect touchpad either report raw pressure or touches */ if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOUCH) && !libevdev_has_event_code(evdev, EV_ABS, ABS_PRESSURE)) - goto unwind; + return FALSE; /* all Synaptics-like touchpad report BTN_TOOL_FINGER */ if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_FINGER) || libevdev_has_event_code(evdev, EV_ABS, BTN_TOOL_PEN)) /* Don't match wacom tablets */ - goto unwind; + return FALSE; if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_SLOT)) { if (libevdev_get_num_slots(evdev) == -1) - goto unwind; /* Ignore fake MT devices */ + return FALSE; /* 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; + return FALSE; } - ret = TRUE; - - unwind: - if (test_grab) - libevdev_grab(evdev, LIBEVDEV_UNGRAB); - - return (ret == TRUE); + return TRUE; } #define PRODUCT_ANY 0x0000 @@ -537,8 +536,7 @@ EventQueryHardware(InputInfoPtr pInfo) SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private; struct eventcomm_proto_data *proto_data = priv->proto_data; - if (!event_query_is_touchpad(proto_data->evdev, - (proto_data) ? proto_data->need_grab : TRUE)) + if (!event_query_is_touchpad(proto_data->evdev)) return FALSE; xf86IDrvMsg(pInfo, X_PROBED, "touchpad found\n"); @@ -627,6 +625,14 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw, hw->slot_state[slot_index] = SLOTSTATE_CLOSE; proto_data->num_touches--; } + + /* When there are no fingers on the touchpad, set width and + * pressure to zero as ABS_MT_TOUCH_MAJOR and ABS_MT_PRESSURE + * are not zero when fingers are released. */ + if (proto_data->num_touches == 0) { + hw->fingerWidth = 0; + hw->z = 0; + } } else { ValuatorMask *mask = proto_data->last_mt_vals[slot_index]; @@ -639,6 +645,12 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw, hw->cumulative_dx += ev->value - last_val; else if (ev->code == ABS_MT_POSITION_Y) hw->cumulative_dy += ev->value - last_val; + else if (ev->code == ABS_MT_TOUCH_MAJOR && + priv->has_mt_palm_detect) + hw->fingerWidth = ev->value; + else if (ev->code == ABS_MT_PRESSURE && + priv->has_mt_palm_detect) + hw->z = ev->value; } valuator_mask_set(mask, map, ev->value); @@ -693,14 +705,12 @@ EventReadHwState(InputInfoPtr pInfo, struct eventcomm_proto_data *proto_data = priv->proto_data; Bool sync_cumulative = FALSE; - set_libevdev_log_handler(); - SynapticsResetTouchHwState(hw, FALSE); /* Reset cumulative values if buttons were not previously pressed and no * two-finger scrolling is ongoing, or no finger was previously present. */ if (((!hw->left && !hw->right && !hw->middle) && - !(priv->vert_scroll_twofinger_on || priv->vert_scroll_twofinger_on)) || + !(priv->vert_scroll_twofinger_on || priv->horiz_scroll_twofinger_on)) || hw->z < para->finger_low) { hw->cumulative_dx = hw->x; hw->cumulative_dy = hw->y; @@ -722,6 +732,10 @@ EventReadHwState(InputInfoPtr pInfo, } break; case EV_KEY: + /* ignore hw repeat events */ + if (ev.value > 1) + break; + v = (ev.value ? TRUE : FALSE); switch (ev.code) { case BTN_LEFT: @@ -891,6 +905,10 @@ event_query_touch(InputInfoPtr pInfo) return; } + if (libevdev_has_event_code(dev, EV_ABS, ABS_MT_TOUCH_MAJOR) && + libevdev_has_event_code(dev, EV_ABS, ABS_MT_PRESSURE)) + priv->has_mt_palm_detect = TRUE; + axnum = 0; for (axis = ABS_MT_SLOT + 1; axis <= ABS_MT_MAX; axis++) { int axis_idx = axis - ABS_MT_TOUCH_MAJOR; @@ -951,7 +969,7 @@ EventReadDevDimensions(InputInfoPtr pInfo) proto_data->axis_map[i] = -1; proto_data->cur_slot = -1; - if (event_query_is_touchpad(proto_data->evdev, proto_data->need_grab)) { + if (event_query_is_touchpad(proto_data->evdev)) { event_query_touch(pInfo); event_query_axis_ranges(pInfo); } @@ -985,19 +1003,19 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device) rc = libevdev_new_from_fd(fd, &evdev); if (rc >= 0) { - touchpad_found = event_query_is_touchpad(evdev, TRUE); + touchpad_found = event_query_is_touchpad(evdev); libevdev_free(evdev); } if (!(pInfo->flags & XI86_SERVER_FD)) SYSCALL(close(fd)); - - /* if a device is set and not a touchpad (or already grabbed), - * we must return FALSE. Otherwise, we'll add a device that - * wasn't requested for and repeat - * f5687a6741a19ef3081e7fd83ac55f6df8bcd5c2. */ - return touchpad_found; } + + /* if a device is set and not a touchpad (or already grabbed), + * we must return FALSE. Otherwise, we'll add a device that + * wasn't requested for and repeat + * f5687a6741a19ef3081e7fd83ac55f6df8bcd5c2. */ + return touchpad_found; } i = scandir(DEV_INPUT_EVENT, &namelist, EventDevOnly, alphasort); @@ -1027,7 +1045,7 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device) rc = libevdev_new_from_fd(fd, &evdev); if (rc >= 0) { - touchpad_found = event_query_is_touchpad(evdev, TRUE); + touchpad_found = event_query_is_touchpad(evdev); libevdev_free(evdev); if (touchpad_found) { xf86IDrvMsg(pInfo, X_PROBED, "auto-dev sets device to %s\n", diff --git a/driver/xf86-input-synaptics/src/properties.c b/driver/xf86-input-synaptics/src/properties.c index 718d0543e..c776e6c5c 100644 --- a/driver/xf86-input-synaptics/src/properties.c +++ b/driver/xf86-input-synaptics/src/properties.c @@ -129,6 +129,7 @@ InitTypedAtom(DeviceIntPtr dev, char *name, Atom type, int format, int nvalues, converted = val_16; break; case 32: + default: converted = val_32; break; } diff --git a/driver/xf86-input-synaptics/src/ps2comm.c b/driver/xf86-input-synaptics/src/ps2comm.c index ed2f75130..c474c072d 100644 --- a/driver/xf86-input-synaptics/src/ps2comm.c +++ b/driver/xf86-input-synaptics/src/ps2comm.c @@ -582,12 +582,15 @@ PS2ReadHwStateProto(InputInfoPtr pInfo, case 8: hw->multi[7] = ((buf[5] & 0x08)) ? 1 : 0; hw->multi[6] = ((buf[4] & 0x08)) ? 1 : 0; + /* fallthrough */ case 6: hw->multi[5] = ((buf[5] & 0x04)) ? 1 : 0; hw->multi[4] = ((buf[4] & 0x04)) ? 1 : 0; + /* fallthrough */ case 4: hw->multi[3] = ((buf[5] & 0x02)) ? 1 : 0; hw->multi[2] = ((buf[4] & 0x02)) ? 1 : 0; + /* fallthrough */ case 2: hw->multi[1] = ((buf[5] & 0x01)) ? 1 : 0; hw->multi[0] = ((buf[4] & 0x01)) ? 1 : 0; diff --git a/driver/xf86-input-synaptics/src/synaptics.c b/driver/xf86-input-synaptics/src/synaptics.c index 0d6f6a08f..441c7896d 100644 --- a/driver/xf86-input-synaptics/src/synaptics.c +++ b/driver/xf86-input-synaptics/src/synaptics.c @@ -498,7 +498,7 @@ set_softbutton_areas_option(InputInfoPtr pInfo, char *option_name, int offset) values[i] = value; if (next_num != end_str) { - if (end_str && *end_str == '%') { + if (*end_str == '%') { in_percent |= 1 << i; end_str++; } @@ -674,7 +674,7 @@ set_default_parameters(InputInfoPtr pInfo) pars->finger_high = xf86SetIntOption(opts, "FingerHigh", fingerHigh); pars->tap_time = xf86SetIntOption(opts, "MaxTapTime", 180); pars->tap_move = xf86SetIntOption(opts, "MaxTapMove", tapMove); - pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 100); + pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180); pars->click_time = xf86SetIntOption(opts, "ClickTime", 100); pars->clickpad = xf86SetBoolOption(opts, "ClickPad", pars->clickpad); /* Probed */ if (pars->clickpad) @@ -783,6 +783,23 @@ set_default_parameters(InputInfoPtr pInfo) pars->resolution_vert = 1; } + /* Touchpad sampling rate is too low to detect all movements. + A user may lift one finger and put another one down within the same + EV_SYN or even between samplings so the driver doesn't notice at all. + + We limit the movement to 20 mm within one event, that is more than + recordings showed is needed (17mm on a T440). + */ + if (pars->resolution_horiz > 1 && + pars->resolution_vert > 1) + pars->maxDeltaMM = 20; + else { + /* on devices without resolution set the vector length to 0.25 of + the touchpad diagonal */ + pars->maxDeltaMM = diag * 0.25; + } + + /* Warn about (and fix) incorrectly configured TopEdge/BottomEdge parameters */ if (pars->top_edge > pars->bottom_edge) { int tmp = pars->top_edge; @@ -1176,49 +1193,19 @@ DeviceInitTouch(DeviceIntPtr dev, Atom *axes_labels) { InputInfoPtr pInfo = dev->public.devicePrivate; SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); - int i; - if (priv->has_touch) { - priv->num_slots = - priv->max_touches ? priv->max_touches : SYNAPTICS_MAX_TOUCHES; + if (!priv->has_touch) + return; - priv->open_slots = malloc(priv->num_slots * sizeof(int)); - if (!priv->open_slots) { - xf86IDrvMsg(pInfo, X_ERROR, - "failed to allocate open touch slots array\n"); - priv->has_touch = 0; - priv->num_slots = 0; - return; - } + priv->num_slots = + priv->max_touches ? priv->max_touches : SYNAPTICS_MAX_TOUCHES; - /* x/y + whatever other MT axes we found */ - if (!InitTouchClassDeviceStruct(dev, priv->max_touches, - XIDependentTouch, - 2 + priv->num_mt_axes)) { - xf86IDrvMsg(pInfo, X_ERROR, - "failed to initialize touch class device\n"); - priv->has_touch = 0; - priv->num_slots = 0; - free(priv->open_slots); - priv->open_slots = NULL; - return; - } - - for (i = 0; i < priv->num_mt_axes; i++) { - SynapticsTouchAxisRec *axis = &priv->touch_axes[i]; - int axnum = 4 + i; /* Skip x, y, and scroll axes */ - - if (!xf86InitValuatorAxisStruct(dev, axnum, axes_labels[axnum], - axis->min, axis->max, axis->res, 0, - axis->res, Absolute)) { - xf86IDrvMsg(pInfo, X_WARNING, - "failed to initialize axis %s, skipping\n", - axis->label); - continue; - } - - xf86InitValuatorDefaults(dev, axnum); - } + priv->open_slots = malloc(priv->num_slots * sizeof(int)); + if (!priv->open_slots) { + xf86IDrvMsg(pInfo, X_ERROR, + "failed to allocate open touch slots array\n"); + priv->has_touch = 0; + priv->num_slots = 0; } } @@ -1617,9 +1604,11 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg) SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); struct SynapticsHwState *hw = priv->local_hw_state; int delay; - int sigstate; - - sigstate = xf86BlockSIGIO(); +#if !HAVE_THREADED_INPUT + int sigstate = xf86BlockSIGIO(); +#else + input_lock(); +#endif priv->hwState->millis += now - priv->timer_time; SynapticsCopyHwState(hw, priv->hwState); @@ -1629,7 +1618,11 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg) priv->timer_time = now; priv->timer = TimerSet(priv->timer, 0, delay, timerFunc, pInfo); +#if !HAVE_THREADED_INPUT xf86UnblockSIGIO(sigstate); +#else + input_unlock(); +#endif return 0; } @@ -1815,6 +1808,9 @@ SynapticsDetectFinger(SynapticsPrivate * priv, struct SynapticsHwState *hw) if ((hw->z > para->palm_min_z) && (hw->fingerWidth > para->palm_min_width)) return FS_BLOCKED; + if (priv->has_mt_palm_detect) + return finger; + if (hw->x == 0 || priv->finger_state == FS_UNTOUCHED) priv->avg_width = 0; else @@ -2205,28 +2201,15 @@ static void get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw, enum EdgeType edge, double *dx, double *dy) { - double integral; - double tmpf; - *dx = hw->x - HIST(0).x; *dy = hw->y - HIST(0).y; +} - /* report edge speed as synthetic motion. Of course, it would be - * cooler to report floats than to buffer, but anyway. */ - - /* FIXME: When these values go NaN, bad things happen. Root cause is unknown - * thus far though. */ - if (isnan(priv->frac_x)) - priv->frac_x = 0; - if (isnan(priv->frac_y)) - priv->frac_y = 0; - - tmpf = *dx + priv->frac_x; - priv->frac_x = modf(tmpf, &integral); - *dx = integral; - tmpf = *dy + priv->frac_y; - priv->frac_y = modf(tmpf, &integral); - *dy = integral; +/* Vector length, but not sqrt'ed, we only need it for comparison */ +static inline double +vlenpow2(double x, double y) +{ + return x * x + y * y; } /** @@ -2238,6 +2221,7 @@ ComputeDeltas(SynapticsPrivate * priv, const struct SynapticsHwState *hw, { enum MovingState moving_state; double dx, dy; + double vlen; int delay = 1000000000; dx = dy = 0; @@ -2283,6 +2267,14 @@ ComputeDeltas(SynapticsPrivate * priv, const struct SynapticsHwState *hw, out: priv->prevFingers = hw->numFingers; + vlen = vlenpow2(dx/priv->synpara.resolution_horiz, + dy/priv->synpara.resolution_vert); + + if (vlen > priv->synpara.maxDeltaMM * priv->synpara.maxDeltaMM) { + dx = 0; + dy = 0; + } + *dxP = dx; *dyP = dy; @@ -2976,18 +2968,9 @@ static void HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw) { SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private; - SynapticsParameters *para = &priv->synpara; int new_active_touches = priv->num_active_touches; - int min_touches = 2; - Bool restart_touches = FALSE; int i; - if (para->click_action[F3_CLICK1] || para->tap_action[F3_TAP]) - min_touches = 4; - else if (para->click_action[F2_CLICK1] || para->tap_action[F2_TAP] || - para->scroll_twofinger_vert || para->scroll_twofinger_horiz) - min_touches = 3; - /* Count new number of active touches */ for (i = 0; i < hw->num_mt_mask; i++) { if (hw->slot_state[i] == SLOTSTATE_OPEN) @@ -2996,60 +2979,6 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw) new_active_touches--; } - if (priv->has_semi_mt) - goto out; - - if (priv->num_active_touches < min_touches && - new_active_touches < min_touches) { - /* We stayed below number of touches needed to send events */ - goto out; - } - else if (priv->num_active_touches >= min_touches && - new_active_touches < min_touches) { - /* We are transitioning to less than the number of touches needed to - * send events. End all currently open touches. */ - for (i = 0; i < priv->num_active_touches; i++) { - int slot = priv->open_slots[i]; - - xf86PostTouchEvent(pInfo->dev, slot, XI_TouchEnd, 0, - hw->mt_mask[slot]); - } - - /* Don't send any more events */ - goto out; - } - else if (priv->num_active_touches < min_touches && - new_active_touches >= min_touches) { - /* We are transitioning to more than the number of touches needed to - * send events. Begin all already open touches. */ - restart_touches = TRUE; - for (i = 0; i < priv->num_active_touches; i++) { - int slot = priv->open_slots[i]; - - xf86PostTouchEvent(pInfo->dev, slot, XI_TouchBegin, 0, - hw->mt_mask[slot]); - } - } - - /* Send touch begin events for all new touches */ - for (i = 0; i < hw->num_mt_mask; i++) - if (hw->slot_state[i] == SLOTSTATE_OPEN) - xf86PostTouchEvent(pInfo->dev, i, XI_TouchBegin, 0, hw->mt_mask[i]); - - /* Send touch update/end events for all the rest */ - for (i = 0; i < priv->num_active_touches; i++) { - int slot = priv->open_slots[i]; - - /* Don't send update event if we just reopened the touch above */ - if (hw->slot_state[slot] == SLOTSTATE_UPDATE && !restart_touches) - xf86PostTouchEvent(pInfo->dev, slot, XI_TouchUpdate, 0, - hw->mt_mask[slot]); - else if (hw->slot_state[slot] == SLOTSTATE_CLOSE) - xf86PostTouchEvent(pInfo->dev, slot, XI_TouchEnd, 0, - hw->mt_mask[slot]); - } - - out: UpdateTouchState(pInfo, hw); } diff --git a/driver/xf86-input-synaptics/src/synapticsstr.h b/driver/xf86-input-synaptics/src/synapticsstr.h index 8917991bb..33524e5c6 100644 --- a/driver/xf86-input-synaptics/src/synapticsstr.h +++ b/driver/xf86-input-synaptics/src/synapticsstr.h @@ -36,6 +36,10 @@ #define NO_DRIVER_SCALING 1 #endif +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23 +#define HAVE_THREADED_INPUT 1 +#endif + #ifdef DBG #undef DBG #endif @@ -225,6 +229,8 @@ typedef struct _SynapticsParameters { int area_left_edge, area_right_edge, area_top_edge, area_bottom_edge; /* area coordinates absolute */ int softbutton_areas[4][4]; /* soft button area coordinates, 0 => right, 1 => middle , 2 => secondary right, 3 => secondary middle button */ int hyst_x, hyst_y; /* x and y width of hysteresis box */ + + int maxDeltaMM; /* maximum delta movement (vector length) in mm */ } SynapticsParameters; struct _SynapticsPrivateRec { @@ -282,7 +288,6 @@ struct _SynapticsPrivateRec { Bool circ_scroll_on; /* Keeps track of currently active scroll modes */ Bool circ_scroll_vert; /* True: Generate vertical scroll events False: Generate horizontal events */ - double frac_x, frac_y; /* absolute -> relative fraction */ enum MidButtonEmulation mid_emu_state; /* emulated 3rd button */ int repeatButtons; /* buttons for repeat */ int nextRepeat; /* Time when to trigger next auto repeat event */ @@ -307,6 +312,7 @@ struct _SynapticsPrivateRec { Bool has_width; /* device reports finger width */ Bool has_scrollbuttons; /* device has physical scrollbuttons */ Bool has_semi_mt; /* device is only semi-multitouch capable */ + Bool has_mt_palm_detect; /* device reports per finger width and pressure */ enum TouchpadModel model; /* The detected model */ unsigned short id_vendor; /* vendor id */ diff --git a/driver/xf86-input-synaptics/src/synproto.h b/driver/xf86-input-synaptics/src/synproto.h index 099a9110f..a40d56b4a 100644 --- a/driver/xf86-input-synaptics/src/synproto.h +++ b/driver/xf86-input-synaptics/src/synproto.h @@ -35,7 +35,6 @@ #include #include -#include #include #include diff --git a/driver/xf86-input-synaptics/tools/synclient.c b/driver/xf86-input-synaptics/tools/synclient.c index ac31a66af..32bf91f3c 100644 --- a/driver/xf86-input-synaptics/tools/synclient.c +++ b/driver/xf86-input-synaptics/tools/synclient.c @@ -86,7 +86,6 @@ static struct Parameter params[] = { {"MaxDoubleTapTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS,32, 1}, {"SingleTapTimeout", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS,32, 0}, {"ClickTime", PT_INT, 0, 1000, SYNAPTICS_PROP_TAP_DURATIONS,32, 2}, - {"FastTaps", PT_BOOL, 0, 1, SYNAPTICS_PROP_TAP_FAST, 8, 0}, {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT,32, 0}, {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, diff --git a/driver/xf86-input-synaptics/tools/syndaemon.c b/driver/xf86-input-synaptics/tools/syndaemon.c index 29e75f5dc..f716827a5 100644 --- a/driver/xf86-input-synaptics/tools/syndaemon.c +++ b/driver/xf86-input-synaptics/tools/syndaemon.c @@ -47,6 +47,12 @@ #include "synaptics-properties.h" +enum KeyboardActivity { + ActivityNew, + ActivityNone, + ActivityReset +}; + enum TouchpadState { TouchpadOn = 0, TouchpadOff = 1, @@ -181,29 +187,29 @@ install_signal_handler(void) } } -/** - * Return non-zero if the keyboard state has changed since the last call. - */ -static int +static enum KeyboardActivity keyboard_activity(Display * display) { static unsigned char old_key_state[KEYMAP_SIZE]; unsigned char key_state[KEYMAP_SIZE]; int i; - int ret = 0; + int ret = ActivityNone; XQueryKeymap(display, (char *) key_state); for (i = 0; i < KEYMAP_SIZE; i++) { if ((key_state[i] & ~old_key_state[i]) & keyboard_mask[i]) { - ret = 1; + ret = ActivityNew; break; } } if (ignore_modifier_combos) { for (i = 0; i < KEYMAP_SIZE; i++) { if (key_state[i] & ~keyboard_mask[i]) { - ret = 0; + if (old_key_state[i] & ~keyboard_mask[i]) + ret = ActivityNone; + else + ret = ActivityReset; break; } } @@ -232,8 +238,17 @@ main_loop(Display * display, double idle_time, int poll_delay) for (;;) { current_time = get_time(); - if (keyboard_activity(display)) - last_activity = current_time; + switch (keyboard_activity(display)) { + case ActivityNew: + last_activity = current_time; + break; + case ActivityNone: + /* NOP */; + break; + case ActivityReset: + last_activity = 0.0; + break; + } /* If system times goes backwards, touchpad can get locked. Make * sure our last activity wasn't in the future and reset if it was. */ @@ -423,6 +438,7 @@ record_main_loop(Display * display, double idle_time) fd_set read_fds; int ret; int disable_event = 0; + int modifier_event = 0; struct timeval timeout; FD_ZERO(&read_fds); @@ -454,9 +470,14 @@ record_main_loop(Display * display, double idle_time) disable_event = 1; } - if (cbres.non_modifier_event && - !(ignore_modifier_combos && is_modifier_pressed(&cbres))) { - disable_event = 1; + if (cbres.non_modifier_event) { + if (ignore_modifier_combos && is_modifier_pressed(&cbres)) { + modifier_event = 1; + } else { + disable_event = 1; + } + } else if (ignore_modifier_keys) { + modifier_event = 1; } } @@ -468,10 +489,13 @@ record_main_loop(Display * display, double idle_time) toggle_touchpad(False); } - if (ret == 0 && pad_disabled) { /* timeout => enable event */ + if (modifier_event && pad_disabled) { toggle_touchpad(True); } + if (ret == 0 && pad_disabled) { /* timeout => enable event */ + toggle_touchpad(True); + } } /* end while(1) */ XFreeModifiermap(cbres.modifiers);