gestures: avoid processing the last hold and motion event twice
authorJosé Expósito <jose.exposito89@gmail.com>
Thu, 7 Oct 2021 06:34:43 +0000 (08:34 +0200)
committerJosé Expósito <jose.exposito89@gmail.com>
Thu, 7 Oct 2021 06:34:43 +0000 (08:34 +0200)
During the transition from GESTURE_STATE_HOLD_AND_MOTION to
GESTURE_STATE_POINTER_MOTION the last pointer motion event was
processed twice.

Fix #680

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
src/evdev-mt-touchpad-gestures.c

index aa949ae..a9f4644 100644 (file)
@@ -1256,12 +1256,12 @@ tp_gesture_post_gesture(struct tp_dispatch *tp, uint64_t time,
        if (tp->gesture.state == GESTURE_STATE_HOLD)
                tp_gesture_handle_state_hold(tp, time, ignore_motion);
 
-       if (tp->gesture.state == GESTURE_STATE_HOLD_AND_MOTION)
-               tp_gesture_handle_state_hold_and_pointer_motion(tp, time);
-
        if (tp->gesture.state == GESTURE_STATE_POINTER_MOTION)
                tp_gesture_handle_state_pointer_motion(tp, time);
 
+       if (tp->gesture.state == GESTURE_STATE_HOLD_AND_MOTION)
+               tp_gesture_handle_state_hold_and_pointer_motion(tp, time);
+
        if (tp->gesture.state == GESTURE_STATE_SCROLL)
                tp_gesture_handle_state_scroll(tp, time);