[PATCH libinput 2/4] touchpad: reset the wobble detection for non-pointer events

Peter Hutterer peter.hutterer at who-t.net
Mon Apr 30 05:33:03 UTC 2018


If we get an event other than a motion event we're not wobbling so we need to
reset and restart.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index dc2ed8dc..704d238a 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -155,9 +155,14 @@ tp_detect_wobbling(struct tp_dispatch *tp,
 	int dx, dy;
 	uint64_t dtime;
 
-	if (!(tp->queued & TOUCHPAD_EVENT_MOTION) || tp->hysteresis.enabled)
+	if (tp->hysteresis.enabled)
 		return;
 
+	if (!(tp->queued & TOUCHPAD_EVENT_MOTION)) {
+		t->hysteresis.x_motion_history = 0;
+		return;
+	}
+
 	if (t->last_point.x == 0) { /* first invocation */
 		dx = 0;
 		dy = 0;
-- 
2.14.3



More information about the wayland-devel mailing list