aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2024-02-28 17:49:58 +0100
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2024-02-28 14:28:11 -0500
commitfca8474e9bd64bff8df16fdaf409d5f575ba9501 (patch)
treef310c4062fa1bcbd49fc9397a5386953050f1a61 /sway
parenttext_input: don't destroy scene_node twice (diff)
downloadsway-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')
-rw-r--r--sway/commands/seat/cursor.c14
-rw-r--r--sway/input/cursor.c16
-rw-r--r--sway/input/seat.c4
-rw-r--r--sway/input/seatop_default.c34
-rw-r--r--sway/input/seatop_down.c2
-rw-r--r--sway/input/seatop_move_floating.c2
-rw-r--r--sway/input/seatop_move_tiling.c2
-rw-r--r--sway/input/seatop_resize_floating.c2
-rw-r--r--sway/input/seatop_resize_tiling.c2
9 files changed, 39 insertions, 39 deletions
diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c
index 85c5edca..df7c379d 100644
--- a/sway/commands/seat/cursor.c
+++ b/sway/commands/seat/cursor.c
@@ -84,12 +84,12 @@ struct cmd_results *seat_cmd_cursor(int argc, char **argv) {
84 84
85static struct cmd_results *press_or_release(struct sway_cursor *cursor, 85static struct cmd_results *press_or_release(struct sway_cursor *cursor,
86 char *action, char *button_str) { 86 char *action, char *button_str) {
87 enum wlr_button_state state; 87 enum wl_pointer_button_state state;
88 uint32_t button; 88 uint32_t button;
89 if (strcasecmp(action, "press") == 0) { 89 if (strcasecmp(action, "press") == 0) {
90 state = WLR_BUTTON_PRESSED; 90 state = WL_POINTER_BUTTON_STATE_PRESSED;
91 } else if (strcasecmp(action, "release") == 0) { 91 } else if (strcasecmp(action, "release") == 0) {
92 state = WLR_BUTTON_RELEASED; 92 state = WL_POINTER_BUTTON_STATE_RELEASED;
93 } else { 93 } else {
94 return cmd_results_new(CMD_INVALID, "%s", expected_syntax); 94 return cmd_results_new(CMD_INVALID, "%s", expected_syntax);
95 } 95 }
@@ -104,16 +104,16 @@ static struct cmd_results *press_or_release(struct sway_cursor *cursor,
104 } else if (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_DOWN 104 } else if (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_DOWN
105 || button == SWAY_SCROLL_LEFT || button == SWAY_SCROLL_RIGHT) { 105 || button == SWAY_SCROLL_LEFT || button == SWAY_SCROLL_RIGHT) {
106 // Dispatch axis event 106 // Dispatch axis event
107 enum wlr_axis_orientation orientation = 107 enum wl_pointer_axis orientation =
108 (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_DOWN) 108 (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_DOWN)
109 ? WLR_AXIS_ORIENTATION_VERTICAL 109 ? WL_POINTER_AXIS_VERTICAL_SCROLL
110 : WLR_AXIS_ORIENTATION_HORIZONTAL; 110 : WL_POINTER_AXIS_HORIZONTAL_SCROLL;
111 double delta = (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_LEFT) 111 double delta = (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_LEFT)
112 ? -1 : 1; 112 ? -1 : 1;
113 struct wlr_pointer_axis_event event = { 113 struct wlr_pointer_axis_event event = {
114 .pointer = NULL, 114 .pointer = NULL,
115 .time_msec = 0, 115 .time_msec = 0,
116 .source = WLR_AXIS_SOURCE_WHEEL, 116 .source = WL_POINTER_AXIS_SOURCE_WHEEL,
117 .orientation = orientation, 117 .orientation = orientation,
118 .delta = delta * 15, 118 .delta = delta * 15,
119 .delta_discrete = delta 119 .delta_discrete = delta
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
357void dispatch_cursor_button(struct sway_cursor *cursor, 357void 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 }
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 9dd078c6..7ae29828 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1520,7 +1520,7 @@ struct seat_config *seat_get_config_by_name(const char *name) {
1520} 1520}
1521 1521
1522void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, 1522void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,
1523 uint32_t button, enum wlr_button_state state) { 1523 uint32_t button, enum wl_pointer_button_state state) {
1524 seat->last_button_serial = wlr_seat_pointer_notify_button(seat->wlr_seat, 1524 seat->last_button_serial = wlr_seat_pointer_notify_button(seat->wlr_seat,
1525 time_msec, button, state); 1525 time_msec, button, state);
1526} 1526}
@@ -1557,7 +1557,7 @@ void seatop_unref(struct sway_seat *seat, struct sway_container *con) {
1557 1557
1558void seatop_button(struct sway_seat *seat, uint32_t time_msec, 1558void seatop_button(struct sway_seat *seat, uint32_t time_msec,
1559 struct wlr_input_device *device, uint32_t button, 1559 struct wlr_input_device *device, uint32_t button,
1560 enum wlr_button_state state) { 1560 enum wl_pointer_button_state state) {
1561 if (seat->seatop_impl->button) { 1561 if (seat->seatop_impl->button) {
1562 seat->seatop_impl->button(seat, time_msec, device, button, state); 1562 seat->seatop_impl->button(seat, time_msec, device, button, state);
1563 } 1563 }
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index f2a9c2cd..0c6f7c5e 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -290,7 +290,7 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
290 290
291static bool trigger_pointer_button_binding(struct sway_seat *seat, 291static bool trigger_pointer_button_binding(struct sway_seat *seat,
292 struct wlr_input_device *device, uint32_t button, 292 struct wlr_input_device *device, uint32_t button,
293 enum wlr_button_state state, uint32_t modifiers, 293 enum wl_pointer_button_state state, uint32_t modifiers,
294 bool on_titlebar, bool on_border, bool on_contents, bool on_workspace) { 294 bool on_titlebar, bool on_border, bool on_contents, bool on_workspace) {
295 // We can reach this for non-pointer devices if we're currently emulating 295 // We can reach this for non-pointer devices if we're currently emulating
296 // pointer input for one. Emulated input should not trigger bindings. The 296 // pointer input for one. Emulated input should not trigger bindings. The
@@ -304,7 +304,7 @@ static bool trigger_pointer_button_binding(struct sway_seat *seat,
304 char *device_identifier = device ? input_device_get_identifier(device) 304 char *device_identifier = device ? input_device_get_identifier(device)
305 : strdup("*"); 305 : strdup("*");
306 struct sway_binding *binding = NULL; 306 struct sway_binding *binding = NULL;
307 if (state == WLR_BUTTON_PRESSED) { 307 if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
308 state_add_button(e, button); 308 state_add_button(e, button);
309 binding = get_active_mouse_binding(e, 309 binding = get_active_mouse_binding(e,
310 config->current_mode->mouse_bindings, modifiers, false, 310 config->current_mode->mouse_bindings, modifiers, false,
@@ -329,7 +329,7 @@ static bool trigger_pointer_button_binding(struct sway_seat *seat,
329 329
330static void handle_button(struct sway_seat *seat, uint32_t time_msec, 330static void handle_button(struct sway_seat *seat, uint32_t time_msec,
331 struct wlr_input_device *device, uint32_t button, 331 struct wlr_input_device *device, uint32_t button,
332 enum wlr_button_state state) { 332 enum wl_pointer_button_state state) {
333 struct sway_cursor *cursor = seat->cursor; 333 struct sway_cursor *cursor = seat->cursor;
334 334
335 // Determine what's under the cursor 335 // Determine what's under the cursor
@@ -362,7 +362,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
362 362
363 // Handle clicking an empty workspace 363 // Handle clicking an empty workspace
364 if (node && node->type == N_WORKSPACE) { 364 if (node && node->type == N_WORKSPACE) {
365 if (state == WLR_BUTTON_PRESSED) { 365 if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
366 seat_set_focus(seat, node); 366 seat_set_focus(seat, node);
367 transaction_commit_dirty(); 367 transaction_commit_dirty();
368 } 368 }
@@ -377,7 +377,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
377 seat_set_focus_layer(seat, layer); 377 seat_set_focus_layer(seat, layer);
378 transaction_commit_dirty(); 378 transaction_commit_dirty();
379 } 379 }
380 if (state == WLR_BUTTON_PRESSED) { 380 if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
381 seatop_begin_down_on_surface(seat, surface, sx, sy); 381 seatop_begin_down_on_surface(seat, surface, sx, sy);
382 } 382 }
383 seat_pointer_notify_button(seat, time_msec, button, state); 383 seat_pointer_notify_button(seat, time_msec, button, state);
@@ -386,7 +386,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
386 386
387 // Handle tiling resize via border 387 // Handle tiling resize via border
388 if (cont && resize_edge && button == BTN_LEFT && 388 if (cont && resize_edge && button == BTN_LEFT &&
389 state == WLR_BUTTON_PRESSED && !is_floating) { 389 state == WL_POINTER_BUTTON_STATE_PRESSED && !is_floating) {
390 // If a resize is triggered on a tabbed or stacked container, change 390 // If a resize is triggered on a tabbed or stacked container, change
391 // focus to the tab which already had inactive focus -- otherwise, we'd 391 // focus to the tab which already had inactive focus -- otherwise, we'd
392 // change the active tab when the user probably just wanted to resize. 392 // change the active tab when the user probably just wanted to resize.
@@ -404,7 +404,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
404 // Handle tiling resize via mod 404 // Handle tiling resize via mod
405 bool mod_pressed = modifiers & config->floating_mod; 405 bool mod_pressed = modifiers & config->floating_mod;
406 if (cont && !is_floating_or_child && mod_pressed && 406 if (cont && !is_floating_or_child && mod_pressed &&
407 state == WLR_BUTTON_PRESSED) { 407 state == WL_POINTER_BUTTON_STATE_PRESSED) {
408 uint32_t btn_resize = config->floating_mod_inverse ? 408 uint32_t btn_resize = config->floating_mod_inverse ?
409 BTN_LEFT : BTN_RIGHT; 409 BTN_LEFT : BTN_RIGHT;
410 if (button == btn_resize) { 410 if (button == btn_resize) {
@@ -432,7 +432,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
432 } 432 }
433 433
434 // Handle changing focus when clicking on a container 434 // Handle changing focus when clicking on a container
435 if (cont && state == WLR_BUTTON_PRESSED) { 435 if (cont && state == WL_POINTER_BUTTON_STATE_PRESSED) {
436 // Default case: focus the container that was just clicked. 436 // Default case: focus the container that was just clicked.
437 node = &cont->node; 437 node = &cont->node;
438 438
@@ -453,7 +453,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
453 453
454 // Handle beginning floating move 454 // Handle beginning floating move
455 if (cont && is_floating_or_child && !is_fullscreen_or_child && 455 if (cont && is_floating_or_child && !is_fullscreen_or_child &&
456 state == WLR_BUTTON_PRESSED) { 456 state == WL_POINTER_BUTTON_STATE_PRESSED) {
457 uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; 457 uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT;
458 if (button == btn_move && (mod_pressed || on_titlebar)) { 458 if (button == btn_move && (mod_pressed || on_titlebar)) {
459 seatop_begin_move_floating(seat, container_toplevel_ancestor(cont)); 459 seatop_begin_move_floating(seat, container_toplevel_ancestor(cont));
@@ -463,7 +463,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
463 463
464 // Handle beginning floating resize 464 // Handle beginning floating resize
465 if (cont && is_floating_or_child && !is_fullscreen_or_child && 465 if (cont && is_floating_or_child && !is_fullscreen_or_child &&
466 state == WLR_BUTTON_PRESSED) { 466 state == WL_POINTER_BUTTON_STATE_PRESSED) {
467 // Via border 467 // Via border
468 if (button == BTN_LEFT && resize_edge != WLR_EDGE_NONE) { 468 if (button == BTN_LEFT && resize_edge != WLR_EDGE_NONE) {
469 seat_set_focus_container(seat, cont); 469 seat_set_focus_container(seat, cont);
@@ -489,7 +489,7 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
489 489
490 // Handle moving a tiling container 490 // Handle moving a tiling container
491 if (config->tiling_drag && (mod_pressed || on_titlebar) && 491 if (config->tiling_drag && (mod_pressed || on_titlebar) &&
492 state == WLR_BUTTON_PRESSED && !is_floating_or_child && 492 state == WL_POINTER_BUTTON_STATE_PRESSED && !is_floating_or_child &&
493 cont && cont->pending.fullscreen_mode == FULLSCREEN_NONE) { 493 cont && cont->pending.fullscreen_mode == FULLSCREEN_NONE) {
494 // If moving a container by its title bar, use a threshold for the drag 494 // If moving a container by its title bar, use a threshold for the drag
495 if (!mod_pressed && config->tiling_drag_threshold > 0) { 495 if (!mod_pressed && config->tiling_drag_threshold > 0) {
@@ -502,14 +502,14 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
502 } 502 }
503 503
504 // Handle mousedown on a container surface 504 // Handle mousedown on a container surface
505 if (surface && cont && state == WLR_BUTTON_PRESSED) { 505 if (surface && cont && state == WL_POINTER_BUTTON_STATE_PRESSED) {
506 seatop_begin_down(seat, cont, sx, sy); 506 seatop_begin_down(seat, cont, sx, sy);
507 seat_pointer_notify_button(seat, time_msec, button, WLR_BUTTON_PRESSED); 507 seat_pointer_notify_button(seat, time_msec, button, WL_POINTER_BUTTON_STATE_PRESSED);
508 return; 508 return;
509 } 509 }
510 510
511 // Handle clicking a container surface or decorations 511 // Handle clicking a container surface or decorations
512 if (cont && state == WLR_BUTTON_PRESSED) { 512 if (cont && state == WL_POINTER_BUTTON_STATE_PRESSED) {
513 seat_pointer_notify_button(seat, time_msec, button, state); 513 seat_pointer_notify_button(seat, time_msec, button, state);
514 return; 514 return;
515 } 515 }
@@ -684,7 +684,7 @@ static void handle_touch_down(struct sway_seat *seat,
684 pointer_motion(cursor, event->time_msec, &event->touch->base, dx, dy, 684 pointer_motion(cursor, event->time_msec, &event->touch->base, dx, dy,
685 dx, dy); 685 dx, dy);
686 dispatch_cursor_button(cursor, &event->touch->base, event->time_msec, 686 dispatch_cursor_button(cursor, &event->touch->base, event->time_msec,
687 BTN_LEFT, WLR_BUTTON_PRESSED); 687 BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED);
688 } 688 }
689} 689}
690 690
@@ -694,9 +694,9 @@ static void handle_touch_down(struct sway_seat *seat,
694 694
695static uint32_t wl_axis_to_button(struct wlr_pointer_axis_event *event) { 695static uint32_t wl_axis_to_button(struct wlr_pointer_axis_event *event) {
696 switch (event->orientation) { 696 switch (event->orientation) {
697 case WLR_AXIS_ORIENTATION_VERTICAL: 697 case WL_POINTER_AXIS_VERTICAL_SCROLL:
698 return event->delta < 0 ? SWAY_SCROLL_UP : SWAY_SCROLL_DOWN; 698 return event->delta < 0 ? SWAY_SCROLL_UP : SWAY_SCROLL_DOWN;
699 case WLR_AXIS_ORIENTATION_HORIZONTAL: 699 case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
700 return event->delta < 0 ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT; 700 return event->delta < 0 ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT;
701 default: 701 default:
702 sway_log(SWAY_DEBUG, "Unknown axis orientation"); 702 sway_log(SWAY_DEBUG, "Unknown axis orientation");
diff --git a/sway/input/seatop_down.c b/sway/input/seatop_down.c
index 12d7ae7a..35fd3bcb 100644
--- a/sway/input/seatop_down.c
+++ b/sway/input/seatop_down.c
@@ -142,7 +142,7 @@ static void handle_pointer_axis(struct sway_seat *seat,
142 142
143static void handle_button(struct sway_seat *seat, uint32_t time_msec, 143static void handle_button(struct sway_seat *seat, uint32_t time_msec,
144 struct wlr_input_device *device, uint32_t button, 144 struct wlr_input_device *device, uint32_t button,
145 enum wlr_button_state state) { 145 enum wl_pointer_button_state state) {
146 seat_pointer_notify_button(seat, time_msec, button, state); 146 seat_pointer_notify_button(seat, time_msec, button, state);
147 147
148 if (seat->cursor->pressed_button_count == 0) { 148 if (seat->cursor->pressed_button_count == 0) {
diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c
index 7de3f4d8..83668d88 100644
--- a/sway/input/seatop_move_floating.c
+++ b/sway/input/seatop_move_floating.c
@@ -21,7 +21,7 @@ static void finalize_move(struct sway_seat *seat) {
21 21
22static void handle_button(struct sway_seat *seat, uint32_t time_msec, 22static void handle_button(struct sway_seat *seat, uint32_t time_msec,
23 struct wlr_input_device *device, uint32_t button, 23 struct wlr_input_device *device, uint32_t button,
24 enum wlr_button_state state) { 24 enum wl_pointer_button_state state) {
25 if (seat->cursor->pressed_button_count == 0) { 25 if (seat->cursor->pressed_button_count == 0) {
26 finalize_move(seat); 26 finalize_move(seat);
27 } 27 }
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c
index 4f4d6e41..c525b77a 100644
--- a/sway/input/seatop_move_tiling.c
+++ b/sway/input/seatop_move_tiling.c
@@ -405,7 +405,7 @@ static void finalize_move(struct sway_seat *seat) {
405 405
406static void handle_button(struct sway_seat *seat, uint32_t time_msec, 406static void handle_button(struct sway_seat *seat, uint32_t time_msec,
407 struct wlr_input_device *device, uint32_t button, 407 struct wlr_input_device *device, uint32_t button,
408 enum wlr_button_state state) { 408 enum wl_pointer_button_state state) {
409 if (seat->cursor->pressed_button_count == 0) { 409 if (seat->cursor->pressed_button_count == 0) {
410 finalize_move(seat); 410 finalize_move(seat);
411 } 411 }
diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c
index 168dfffe..bec86e33 100644
--- a/sway/input/seatop_resize_floating.c
+++ b/sway/input/seatop_resize_floating.c
@@ -20,7 +20,7 @@ struct seatop_resize_floating_event {
20 20
21static void handle_button(struct sway_seat *seat, uint32_t time_msec, 21static void handle_button(struct sway_seat *seat, uint32_t time_msec,
22 struct wlr_input_device *device, uint32_t button, 22 struct wlr_input_device *device, uint32_t button,
23 enum wlr_button_state state) { 23 enum wl_pointer_button_state state) {
24 struct seatop_resize_floating_event *e = seat->seatop_data; 24 struct seatop_resize_floating_event *e = seat->seatop_data;
25 struct sway_container *con = e->con; 25 struct sway_container *con = e->con;
26 26
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c
index 9ce4ff8b..15fd333b 100644
--- a/sway/input/seatop_resize_tiling.c
+++ b/sway/input/seatop_resize_tiling.c
@@ -45,7 +45,7 @@ static struct sway_container *container_get_resize_sibling(
45 45
46static void handle_button(struct sway_seat *seat, uint32_t time_msec, 46static void handle_button(struct sway_seat *seat, uint32_t time_msec,
47 struct wlr_input_device *device, uint32_t button, 47 struct wlr_input_device *device, uint32_t button,
48 enum wlr_button_state state) { 48 enum wl_pointer_button_state state) {
49 struct seatop_resize_tiling_event *e = seat->seatop_data; 49 struct seatop_resize_tiling_event *e = seat->seatop_data;
50 50
51 if (seat->cursor->pressed_button_count == 0) { 51 if (seat->cursor->pressed_button_count == 0) {