gestures: rename tp_gesture_handle_state and tp_gesture_post_gesture
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 10 Sep 2024 03:00:36 +0000 (13:00 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 4 Oct 2024 05:13:23 +0000 (15:13 +1000)
Confusingly, tp_gesture_handle_state() would do almost nothing with our
state machine and the various tp_gesture_handle_state_foo() were called
later from tp_gesture_post_gesture().

Rename those functions into so that we have
tp_gesture_update_finger_state() first followed by
tp_gesture_handle_state() which is responsible for dealing with the
state machine.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1049>

src/evdev-mt-touchpad-gestures.c
src/evdev-mt-touchpad.c
src/evdev-mt-touchpad.h

index 5204dc74385018782631810716ad5fc3e9daf8e8..7e52ecb8e72c8ca243d9a96b594df516fd6e7078 100644 (file)
@@ -1247,7 +1247,7 @@ tp_gesture_handle_state_pinch(struct tp_dispatch *tp, uint64_t time)
 }
 
 static void
-tp_gesture_post_gesture(struct tp_dispatch *tp, uint64_t time,
+tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time,
                        bool ignore_motion)
 {
        if (tp->gesture.state == GESTURE_STATE_NONE)
@@ -1330,7 +1330,7 @@ tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time,
                tp_thumb_reset(tp);
 
        if (tp->gesture.finger_count <= 4)
-               tp_gesture_post_gesture(tp, time, ignore_motion);
+               tp_gesture_handle_state(tp, time, ignore_motion);
 }
 
 void
@@ -1422,7 +1422,7 @@ tp_gesture_finger_count_switch_timeout(uint64_t now, void *data)
 }
 
 void
-tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time)
+tp_gesture_update_finger_state(struct tp_dispatch *tp, uint64_t time)
 {
        unsigned int active_touches = 0;
        struct tp_touch *t;
index 9bc6bf6afec4236461f3895c5a24073823a77928..9c219a68d16cc9243ea80691bdbdb8ab939cd101 100644 (file)
@@ -1812,7 +1812,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time)
            tp->buttons.is_clickpad)
                tp_pin_fingers(tp);
 
-       tp_gesture_handle_state(tp, time);
+       tp_gesture_update_finger_state(tp, time);
 }
 
 static void
index 55547014390e29c092b9e4e6e87669e61d7f096e..d2842651b70dcd80798d980c91e27dd546b0acff 100644 (file)
@@ -725,7 +725,7 @@ void
 tp_gesture_cancel_motion_gestures(struct tp_dispatch *tp, uint64_t time);
 
 void
-tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time);
+tp_gesture_update_finger_state(struct tp_dispatch *tp, uint64_t time);
 
 void
 tp_gesture_post_events(struct tp_dispatch *tp, uint64_t time,