From cb7cef6f4b63dc87248c6334fa1e5fa0b3532970 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 4 Aug 2016 15:23:43 +1000 Subject: [PATCH] touchpad: on a non-clickpad, reset the motion history on nfingers change The only reason to have more than one finger on a non-clickpad is to tap, scroll or gesture. In all cases resetting the motion history is a good idea to avoid jumps moving from 2 to 1 finger. https://bugs.freedesktop.org/show_bug.cgi?id=97194 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede (cherry picked from commit 3cb60130c182cb4bbfa8f908218fb12e84866cd5) --- src/evdev-mt-touchpad.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 756d2839..f15cfef6 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -955,8 +955,11 @@ tp_need_motion_history_reset(struct tp_dispatch *tp) { bool rc = false; - /* semi-mt finger postions may "jump" when nfingers changes */ - if (tp->semi_mt && tp->nfingers_down != tp->old_nfingers_down) + /* Semi-mt finger postions may "jump" when nfingers changes. And on + * a non-clickpad the only reason to have more than one finger down + * is scrolling/gesture, so a reset just makes things sane again */ + if ((tp->semi_mt || !tp->buttons.is_clickpad) && + tp->nfingers_down != tp->old_nfingers_down) return true; /* if we're transitioning between slots and fake touches in either