From be7da7f7daa3b551bb9418b62bc5490ddcfa21e7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Jun 2017 14:13:26 +1000 Subject: touchpad: ignore the tap motion threshold if fingers > slots Do so on the synaptics serial touchpads at least, they're known to cause cursor jumps when the third finger is down. Not detecting a tap move means three-finger taps get more reliable on these touchpads. This change affects gestures who now effectively have to wait for the tap timeout to happen. It's a trade-off. https://bugs.freedesktop.org/show_bug.cgi?id=101435 https://bugzilla.redhat.com/show_bug.cgi?id=1455443 Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad-tap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c index 5a237fe..3ab3316 100644 --- a/src/evdev-mt-touchpad-tap.c +++ b/src/evdev-mt-touchpad-tap.c @@ -768,6 +768,18 @@ tp_tap_exceeds_motion_threshold(struct tp_dispatch *tp, struct phys_coords mm = tp_phys_delta(tp, device_delta(t->point, t->tap.initial)); + /* if we have more fingers down than slots, we know that synaptics + * touchpads are likely to give us pointer jumps. + * This triggers the movement threshold, making three-finger taps + * less reliable (#101435) + */ + if (tp->device->model_flags & EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD && + (tp->nfingers_down > 2 || tp->old_nfingers_down > 2) && + (tp->nfingers_down > tp->num_slots || + tp->old_nfingers_down > tp->num_slots)) { + return false; + } + return length_in_mm(mm) > DEFAULT_TAP_MOVE_THRESHOLD; } -- cgit v1.2.3