summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-08-26 11:59:47 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-10-07 08:14:21 +1000
commitc856f26dd77e5b0b5fd3862e572be456629de943 (patch)
tree3a9cf95fbbec352f79116d7b3b948aaa56a6c0e9
parent2e5e74c0bc7dc62831ed2d10ea1028abed37b382 (diff)
downloadlibinput-c856f26dd77e5b0b5fd3862e572be456629de943.tar.gz
touchpad: ignore the ALPS jump to 4095/0
Some ALPS touchpad send the occasional 4095/0 event on slot 1 during two-finger interaction before snapping back to the actual position of the finger. There doesn't seem to be a specific heuristic to predict this so let's hardcode those values. When detected, overwrite the current touch point with the position of the last point. This will likely cause a small pointer jump when the finger later moves to the real position but based on #492 this could be a second later, so all bets are off anyway. Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/492 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 0c5112155600629fc6ac8d927d66118554180ecc)
-rw-r--r--doc/user/touchpad-jumping-cursors.rst14
-rw-r--r--src/evdev-mt-touchpad.c13
2 files changed, 27 insertions, 0 deletions
diff --git a/doc/user/touchpad-jumping-cursors.rst b/doc/user/touchpad-jumping-cursors.rst
index f1c49d74..e1b065a1 100644
--- a/doc/user/touchpad-jumping-cursors.rst
+++ b/doc/user/touchpad-jumping-cursors.rst
@@ -64,3 +64,17 @@ See :ref:`reporting_bugs` for more details.
Note that it most cases, libinput cannot actually fix the issue. Filing a
bug is useful to figure out if there are other factors at play or whether
there are heuristics we can employ to reduce the impact.
+
+------------------------------------------------------------------------------
+AlpsPS/2 ALPS DualPoint TouchPad jumping to 4095/0
+------------------------------------------------------------------------------
+
+A special case of pointer jumps happens on ``AlpsPS/2 ALPS DualPoint TouchPad``
+devices found in the Lenovo ThinkPad E465 and E550 and likely others with
+the same touchpad hardware. On those devices, the touchpad occasionally
+sends an event for the second finger to move to position 4095/0 before
+moving back to the original position. libinput detects this movement and
+removes it but depending on the interaction this may cause a smaller jump
+later when the coordinates reset to the new position of the finger.
+
+Some more information is available in `Gitlab Issue #492 <https://gitlab.freedesktop.org/libinput/libinput/-/issues/492>`__.
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 9bee7606..4064a8ea 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1542,6 +1542,19 @@ tp_detect_jumps(const struct tp_dispatch *tp,
abs_distance = hypot(mm.x, mm.y) * reference_interval/tdelta;
rel_distance = abs_distance - t->jumps.last_delta_mm;
+ /* Special case for the ALPS devices in the Lenovo ThinkPad E465,
+ * E550. These devices send occasional 4095/0 events on two fingers
+ * before snapping back to the correct position.
+ * https://gitlab.freedesktop.org/libinput/libinput/-/issues/492
+ * The specific values are hardcoded here, if this ever happens on
+ * any other device we can make it absmax/absmin instead.
+ */
+ if (tp->device->model_flags & EVDEV_MODEL_ALPS_SERIAL_TOUCHPAD &&
+ t->point.x == 4095 && t->point.y == 0) {
+ t->point = last->point;
+ return true;
+ }
+
/* Cursor jump if:
* - current single-event delta is >20mm, or
* - we increased the delta by over 7mm within a 12ms frame.