gestures: rename gesture_notify_hold to gesture_notify_hold_begin()
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 13 Sep 2024 01:58:26 +0000 (11:58 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 4 Oct 2024 05:13:23 +0000 (15:13 +1000)
HOLD gestures only have begin/end so let's rename this so it's
immediately obvious which one we're sending.

notify_swipe/pinch pass the event type in so it's clear that it's a
BEGIN vs an UPDATE.

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

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

index f5dc920e704b162bad6b70f366262379bf5cd220..161b1210a2825d8fb833695e979cb333a46e0802 100644 (file)
@@ -607,8 +607,8 @@ tp_gesture_handle_event_on_state_unknown(struct tp_dispatch *tp,
                break;
        case GESTURE_EVENT_HOLD_TIMEOUT:
                tp->gesture.state = GESTURE_STATE_HOLD;
-               gesture_notify_hold(&tp->device->base, time,
-                                   tp->gesture.finger_count);
+               gesture_notify_hold_begin(&tp->device->base, time,
+                                         tp->gesture.finger_count);
                tp_gesture_start(tp, time);
                break;
        case GESTURE_EVENT_POINTER_MOTION_START:
@@ -748,8 +748,8 @@ tp_gesture_handle_event_on_state_pointer_motion(struct tp_dispatch *tp,
 
                if (first_mm < HOLD_AND_MOTION_THRESHOLD) {
                        tp->gesture.state = GESTURE_STATE_HOLD_AND_MOTION;
-                       gesture_notify_hold(&tp->device->base, time,
-                                           tp->gesture.finger_count);
+                       gesture_notify_hold_begin(&tp->device->base, time,
+                                                 tp->gesture.finger_count);
                        tp_gesture_start(tp, time);
                }
                break;
index dff0aaae67ac07702ab37a0d9ff9b0a7798ecef4..3038d1557d7c79ee57966047ee5978cb03ffbeeb 100644 (file)
@@ -752,9 +752,9 @@ gesture_notify_pinch_end(struct libinput_device *device,
                         bool cancelled);
 
 void
-gesture_notify_hold(struct libinput_device *device,
-                   uint64_t time,
-                   int finger_count);
+gesture_notify_hold_begin(struct libinput_device *device,
+                         uint64_t time,
+                         int finger_count);
 
 void
 gesture_notify_hold_end(struct libinput_device *device,
index 42a58d391c5bef39430543ac5c57603c41860849..76e7235ed8fe877c5d3c8126993c053878938e91 100644 (file)
@@ -3111,9 +3111,9 @@ gesture_notify_pinch_end(struct libinput_device *device,
 }
 
 void
-gesture_notify_hold(struct libinput_device *device,
-                   uint64_t time,
-                   int finger_count)
+gesture_notify_hold_begin(struct libinput_device *device,
+                         uint64_t time,
+                         int finger_count)
 {
        const struct normalized_coords zero = { 0.0, 0.0 };