diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2018-04-24 15:35:46 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2018-05-02 14:17:30 +1000 |
commit | 9c3a597aabc1ad7f004f2bdcc9fa8a423d19417d (patch) | |
tree | a650e0c8d0bb977c33b1c2491785f409893200a4 /src/evdev-mt-touchpad.c | |
parent | be69bcef2c6ac0cd554a0c4441d4799233a9c33e (diff) |
touchpad: reset the wobble detection for non-pointer events
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@who-t.net>
Diffstat (limited to 'src/evdev-mt-touchpad.c')
-rw-r--r-- | src/evdev-mt-touchpad.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 62ed7482..56c618eb 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; |