[PATCH libinput] touchpad: on a non-clickpad, reset the motion history on nfingers change

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 18 06:02:11 UTC 2016


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=91695
https://bugs.freedesktop.org/show_bug.cgi?id=97194

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 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 6cebfa3..3baed09 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -957,8 +957,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
-- 
2.7.4



More information about the wayland-devel mailing list