]> git.mdlowis.com Git - proto/labwc.git/commitdiff
chase: use wayland pointer enums rather than wlr ones
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 19 Mar 2024 00:32:05 +0000 (01:32 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 17 Jul 2024 20:28:59 +0000 (21:28 +0100)
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575

include/input/cursor.h
src/input/cursor.c
src/input/tablet-pad.c
src/input/tablet.c
src/input/touch.c
subprojects/wlroots.wrap

index 24f7326d53afc6c9a97a03c2dfeb65491c407f1b..e9ad4fa26889cc048786f8010dab4c84ef04d1f6 100644 (file)
@@ -11,7 +11,7 @@ struct seat;
 struct server;
 struct wlr_surface;
 struct wlr_scene_node;
-enum wlr_button_state;
+enum wl_pointer_button_state;
 
 /* Cursors used internally by labwc */
 enum lab_cursors {
@@ -150,7 +150,7 @@ void cursor_emulate_move_absolute(struct seat *seat,
                struct wlr_input_device *device,
                double x, double y, uint32_t time_msec);
 void cursor_emulate_button(struct seat *seat,
-               uint32_t button, enum wlr_button_state state, uint32_t time_msec);
+               uint32_t button, enum wl_pointer_button_state state, uint32_t time_msec);
 void cursor_finish(struct seat *seat);
 
 #endif /* LABWC_CURSOR_H */
index 9e0a72a68c440c5786756cbf247dc9bf60c9e33b..6bda5a30d8b52df4fc1e52b5968c3c5c92778663 100644 (file)
@@ -1153,7 +1153,7 @@ cursor_button(struct wl_listener *listener, void *data)
 
        bool notify;
        switch (event->state) {
-       case WLR_BUTTON_PRESSED:
+       case WL_POINTER_BUTTON_STATE_PRESSED:
                notify = cursor_process_button_press(seat, event->button,
                        event->time_msec);
                if (notify) {
@@ -1161,7 +1161,7 @@ cursor_button(struct wl_listener *listener, void *data)
                                event->button, event->state);
                }
                break;
-       case WLR_BUTTON_RELEASED:
+       case WL_POINTER_BUTTON_STATE_RELEASED:
                notify = cursor_process_button_release(seat, event->button,
                        event->time_msec);
                if (notify) {
@@ -1207,19 +1207,19 @@ cursor_emulate_move_absolute(struct seat *seat, struct wlr_input_device *device,
 
 void
 cursor_emulate_button(struct seat *seat, uint32_t button,
-               enum wlr_button_state state, uint32_t time_msec)
+               enum wl_pointer_button_state state, uint32_t time_msec)
 {
        idle_manager_notify_activity(seat->seat);
 
        bool notify;
        switch (state) {
-       case WLR_BUTTON_PRESSED:
+       case WL_POINTER_BUTTON_STATE_PRESSED:
                notify = cursor_process_button_press(seat, button, time_msec);
                if (notify) {
                        wlr_seat_pointer_notify_button(seat->seat, time_msec, button, state);
                }
                break;
-       case WLR_BUTTON_RELEASED:
+       case WL_POINTER_BUTTON_STATE_RELEASED:
                notify = cursor_process_button_release(seat, button, time_msec);
                if (notify) {
                        wlr_seat_pointer_notify_button(seat->seat, time_msec, button, state);
@@ -1272,14 +1272,14 @@ handle_cursor_axis(struct server *server, struct cursor_context *ctx,
                        &server->seat.keyboard_group->keyboard);
 
        enum direction direction = LAB_DIRECTION_INVALID;
-       if (event->orientation == WLR_AXIS_ORIENTATION_HORIZONTAL) {
+       if (event->orientation == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
                int rel = compare_delta(event, &server->seat.smooth_scroll_offset.x);
                if (rel < 0) {
                        direction = LAB_DIRECTION_LEFT;
                } else if (rel > 0) {
                        direction = LAB_DIRECTION_RIGHT;
                }
-       } else if (event->orientation == WLR_AXIS_ORIENTATION_VERTICAL) {
+       } else if (event->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL) {
                int rel = compare_delta(event, &server->seat.smooth_scroll_offset.y);
                if (rel < 0) {
                        direction = LAB_DIRECTION_UP;
index 37f597ff4fc2bcbe55464647cf89de4425e2a502..0b1fa9b4b0b88aac074dcdd50bd86c722016c6d6 100644 (file)
@@ -116,7 +116,11 @@ handle_button(struct wl_listener *listener, void *data)
        } else {
                uint32_t button = tablet_get_mapped_button(ev->button);
                if (button) {
-                       cursor_emulate_button(pad->seat, button, ev->state, ev->time_msec);
+                       cursor_emulate_button(pad->seat, button,
+                               ev->state == WLR_BUTTON_PRESSED
+                                       ? WL_POINTER_BUTTON_STATE_PRESSED
+                                       : WL_POINTER_BUTTON_STATE_RELEASED,
+                               ev->time_msec);
                }
        }
 }
index 3d8caa61faae28f0dfa81ad11ed6e6729906b5e3..d75eea0eb18aef593047ab0e4fb7b638d459c468 100644 (file)
@@ -441,8 +441,8 @@ handle_tip(struct wl_listener *listener, void *data)
                        cursor_emulate_button(tablet->seat,
                                button,
                                ev->state == WLR_TABLET_TOOL_TIP_DOWN
-                                       ? WLR_BUTTON_PRESSED
-                                       : WLR_BUTTON_RELEASED,
+                                       ? WL_POINTER_BUTTON_STATE_PRESSED
+                                       : WL_POINTER_BUTTON_STATE_RELEASED,
                                ev->time_msec);
                }
        }
@@ -500,7 +500,11 @@ handle_button(struct wl_listener *listener, void *data)
        } else {
                if (button) {
                        is_down_mouse_emulation = ev->state == WLR_BUTTON_PRESSED;
-                       cursor_emulate_button(tablet->seat, button, ev->state, ev->time_msec);
+                       cursor_emulate_button(tablet->seat, button,
+                               ev->state == WLR_BUTTON_PRESSED
+                                       ? WL_POINTER_BUTTON_STATE_PRESSED
+                                       : WL_POINTER_BUTTON_STATE_RELEASED,
+                               ev->time_msec);
                }
        }
 }
index 048aaf2d83cd4006cbb737c37d36128de144d06d..d2419d1a9965dc0149c8eb4dd243eb835dd889be 100644 (file)
@@ -127,7 +127,7 @@ touch_down(struct wl_listener *listener, void *data)
        } else {
                cursor_emulate_move_absolute(seat, &event->touch->base,
                        event->x, event->y, event->time_msec);
-               cursor_emulate_button(seat, BTN_LEFT, WLR_BUTTON_PRESSED,
+               cursor_emulate_button(seat, BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED,
                        event->time_msec);
        }
 }
@@ -146,8 +146,8 @@ touch_up(struct wl_listener *listener, void *data)
                                wlr_seat_touch_notify_up(seat->seat, event->time_msec,
                                        event->touch_id);
                        } else {
-                               cursor_emulate_button(seat, BTN_LEFT, WLR_BUTTON_RELEASED,
-                                       event->time_msec);
+                               cursor_emulate_button(seat, BTN_LEFT,
+                                       WL_POINTER_BUTTON_STATE_RELEASED, event->time_msec);
                        }
                        wl_list_remove(&touch_point->link);
                        zfree(touch_point);
index 62a0f0bada9bdb48a97677ff9a3eee6662458919..f2a1724b980341f4df90a22d8341a8d5d1aef387 100644 (file)
@@ -1,6 +1,6 @@
 [wrap-git]
 url = https://gitlab.freedesktop.org/wlroots/wlroots.git
-revision = 811ca199c444525dc4d846d38f76554f1a9b48b0
+revision = 488a23c16908a83041cf28e134a6f149d831598d
 
 [provide]
 dependency_names = wlroots