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 <[email protected]>
---
 src/evdev-mt-touchpad-gestures.c | 3 ++-
 src/evdev-mt-touchpad.c          | 5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index 3c8f5a7..7bbd3b8 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 f634ec8..e16aecb 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;
-- 
2.5.0

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to