diff options
author | Simon Ser <contact@emersion.fr> | 2024-02-28 17:49:58 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2024-02-28 14:28:11 -0500 |
commit | fca8474e9bd64bff8df16fdaf409d5f575ba9501 (patch) | |
tree | f310c4062fa1bcbd49fc9397a5386953050f1a61 /sway/input/cursor.c | |
parent | text_input: don't destroy scene_node twice (diff) | |
download | sway-fca8474e9bd64bff8df16fdaf409d5f575ba9501.tar.gz sway-fca8474e9bd64bff8df16fdaf409d5f575ba9501.tar.zst sway-fca8474e9bd64bff8df16fdaf409d5f575ba9501.zip |
Convert to new pointer enums
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index e8cd8112..7d66a89d 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -356,7 +356,7 @@ static void handle_pointer_motion_absolute( | |||
356 | 356 | ||
357 | void dispatch_cursor_button(struct sway_cursor *cursor, | 357 | void dispatch_cursor_button(struct sway_cursor *cursor, |
358 | struct wlr_input_device *device, uint32_t time_msec, uint32_t button, | 358 | struct wlr_input_device *device, uint32_t time_msec, uint32_t button, |
359 | enum wlr_button_state state) { | 359 | enum wl_pointer_button_state state) { |
360 | if (time_msec == 0) { | 360 | if (time_msec == 0) { |
361 | time_msec = get_current_time_msec(); | 361 | time_msec = get_current_time_msec(); |
362 | } | 362 | } |
@@ -368,7 +368,7 @@ static void handle_pointer_button(struct wl_listener *listener, void *data) { | |||
368 | struct sway_cursor *cursor = wl_container_of(listener, cursor, button); | 368 | struct sway_cursor *cursor = wl_container_of(listener, cursor, button); |
369 | struct wlr_pointer_button_event *event = data; | 369 | struct wlr_pointer_button_event *event = data; |
370 | 370 | ||
371 | if (event->state == WLR_BUTTON_PRESSED) { | 371 | if (event->state == WL_POINTER_BUTTON_STATE_PRESSED) { |
372 | cursor->pressed_button_count++; | 372 | cursor->pressed_button_count++; |
373 | } else { | 373 | } else { |
374 | if (cursor->pressed_button_count > 0) { | 374 | if (cursor->pressed_button_count > 0) { |
@@ -430,7 +430,7 @@ static void handle_touch_up(struct wl_listener *listener, void *data) { | |||
430 | if (cursor->pointer_touch_id == cursor->seat->touch_id) { | 430 | if (cursor->pointer_touch_id == cursor->seat->touch_id) { |
431 | cursor->pointer_touch_up = true; | 431 | cursor->pointer_touch_up = true; |
432 | dispatch_cursor_button(cursor, &event->touch->base, | 432 | dispatch_cursor_button(cursor, &event->touch->base, |
433 | event->time_msec, BTN_LEFT, WLR_BUTTON_RELEASED); | 433 | event->time_msec, BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); |
434 | } | 434 | } |
435 | } else { | 435 | } else { |
436 | seatop_touch_up(seat, event); | 436 | seatop_touch_up(seat, event); |
@@ -448,7 +448,7 @@ static void handle_touch_cancel(struct wl_listener *listener, void *data) { | |||
448 | if (cursor->pointer_touch_id == cursor->seat->touch_id) { | 448 | if (cursor->pointer_touch_id == cursor->seat->touch_id) { |
449 | cursor->pointer_touch_up = true; | 449 | cursor->pointer_touch_up = true; |
450 | dispatch_cursor_button(cursor, &event->touch->base, | 450 | dispatch_cursor_button(cursor, &event->touch->base, |
451 | event->time_msec, BTN_LEFT, WLR_BUTTON_RELEASED); | 451 | event->time_msec, BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); |
452 | } | 452 | } |
453 | } else { | 453 | } else { |
454 | seatop_touch_cancel(seat, event); | 454 | seatop_touch_cancel(seat, event); |
@@ -661,7 +661,7 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) { | |||
661 | event->state == WLR_TABLET_TOOL_TIP_UP) { | 661 | event->state == WLR_TABLET_TOOL_TIP_UP) { |
662 | cursor->simulating_pointer_from_tool_tip = false; | 662 | cursor->simulating_pointer_from_tool_tip = false; |
663 | dispatch_cursor_button(cursor, &event->tablet->base, event->time_msec, | 663 | dispatch_cursor_button(cursor, &event->tablet->base, event->time_msec, |
664 | BTN_LEFT, WLR_BUTTON_RELEASED); | 664 | BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); |
665 | wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); | 665 | wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); |
666 | } else if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) { | 666 | } else if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) { |
667 | // If we started holding the tool tip down on a surface that accepts | 667 | // If we started holding the tool tip down on a surface that accepts |
@@ -673,7 +673,7 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) { | |||
673 | } else { | 673 | } else { |
674 | cursor->simulating_pointer_from_tool_tip = true; | 674 | cursor->simulating_pointer_from_tool_tip = true; |
675 | dispatch_cursor_button(cursor, &event->tablet->base, | 675 | dispatch_cursor_button(cursor, &event->tablet->base, |
676 | event->time_msec, BTN_LEFT, WLR_BUTTON_PRESSED); | 676 | event->time_msec, BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED); |
677 | wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); | 677 | wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); |
678 | } | 678 | } |
679 | } else { | 679 | } else { |
@@ -776,13 +776,13 @@ static void handle_tool_button(struct wl_listener *listener, void *data) { | |||
776 | case WLR_BUTTON_PRESSED: | 776 | case WLR_BUTTON_PRESSED: |
777 | if (cursor->tool_buttons == 0) { | 777 | if (cursor->tool_buttons == 0) { |
778 | dispatch_cursor_button(cursor, &event->tablet->base, | 778 | dispatch_cursor_button(cursor, &event->tablet->base, |
779 | event->time_msec, BTN_RIGHT, event->state); | 779 | event->time_msec, BTN_RIGHT, WL_POINTER_BUTTON_STATE_PRESSED); |
780 | } | 780 | } |
781 | break; | 781 | break; |
782 | case WLR_BUTTON_RELEASED: | 782 | case WLR_BUTTON_RELEASED: |
783 | if (cursor->tool_buttons <= 1) { | 783 | if (cursor->tool_buttons <= 1) { |
784 | dispatch_cursor_button(cursor, &event->tablet->base, | 784 | dispatch_cursor_button(cursor, &event->tablet->base, |
785 | event->time_msec, BTN_RIGHT, event->state); | 785 | event->time_msec, BTN_RIGHT, WL_POINTER_BUTTON_STATE_RELEASED); |
786 | } | 786 | } |
787 | break; | 787 | break; |
788 | } | 788 | } |