From bc17185f426dae7a1ea4df6ba3459083c2d51f9b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Mar 2016 13:34:00 +1000 Subject: touchpad: only post motion events if we have motion Because our delta calculation factors in previous events on touchpads (to reduce jitter) we may get a nonzero delta if we have an event that doesn't actually change x or y. Drop the t->dirty workaround introduced in a608d9d, an event that virtually disappears can mess up our state machines. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/evdev-mt-touchpad-gestures.c | 3 ++- src/evdev-mt-touchpad.c | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c index 3c8f5a7a..7bbd3b8c 100644 --- a/src/evdev-mt-touchpad-gestures.c +++ b/src/evdev-mt-touchpad-gestures.c @@ -500,7 +500,8 @@ tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time) switch (tp->gesture.finger_count) { case 1: - tp_gesture_post_pointer_motion(tp, time); + if (tp->queued & TOUCHPAD_EVENT_MOTION) + tp_gesture_post_pointer_motion(tp, time); break; case 2: case 3: diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index f634ec86..e16aecbb 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -904,10 +904,7 @@ tp_need_motion_history_reset(struct tp_dispatch *tp) if (tp->device->model_flags & EVDEV_MODEL_LENOVO_T450_TOUCHPAD) { if (tp->queued & TOUCHPAD_EVENT_MOTION) { if (tp->quirks.nonmotion_event_count > 10) { - struct tp_touch *t; - - tp_for_each_touch(tp, t) - t->dirty = false; + tp->queued &= ~TOUCHPAD_EVENT_MOTION; rc = true; } tp->quirks.nonmotion_event_count = 0; -- cgit v1.2.3