diff options
author | Tudor Brindus <me@tbrindus.ca> | 2022-10-09 22:11:09 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-10-10 08:56:51 +0200 |
commit | c7bced9329ede5f0f3732d32e52316f708be62a6 (patch) | |
tree | bfe8fa7ade966471a51e88071cbe16682a339d80 /sway/input/seatop_default.c | |
parent | input: focus floating container when clicked on border (diff) | |
download | sway-c7bced9329ede5f0f3732d32e52316f708be62a6.tar.gz sway-c7bced9329ede5f0f3732d32e52316f708be62a6.tar.zst sway-c7bced9329ede5f0f3732d32e52316f708be62a6.zip |
input: focus container when scrolling on titlebar
Fixes #6503.
Diffstat (limited to 'sway/input/seatop_default.c')
-rw-r--r-- | sway/input/seatop_default.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index 3421cf1a..227b3cc9 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c | |||
@@ -710,6 +710,7 @@ static void handle_pointer_axis(struct sway_seat *seat, | |||
710 | 710 | ||
711 | // Scrolling on a tabbed or stacked title bar (handled as press event) | 711 | // Scrolling on a tabbed or stacked title bar (handled as press event) |
712 | if (!handled && (on_titlebar || on_titlebar_border)) { | 712 | if (!handled && (on_titlebar || on_titlebar_border)) { |
713 | struct sway_node *new_focus; | ||
713 | enum sway_container_layout layout = container_parent_layout(cont); | 714 | enum sway_container_layout layout = container_parent_layout(cont); |
714 | if (layout == L_TABBED || layout == L_STACKED) { | 715 | if (layout == L_TABBED || layout == L_STACKED) { |
715 | struct sway_node *tabcontainer = node_get_parent(node); | 716 | struct sway_node *tabcontainer = node_get_parent(node); |
@@ -726,14 +727,16 @@ static void handle_pointer_axis(struct sway_seat *seat, | |||
726 | 727 | ||
727 | struct sway_container *new_sibling_con = siblings->items[desired]; | 728 | struct sway_container *new_sibling_con = siblings->items[desired]; |
728 | struct sway_node *new_sibling = &new_sibling_con->node; | 729 | struct sway_node *new_sibling = &new_sibling_con->node; |
729 | struct sway_node *new_focus = | ||
730 | seat_get_focus_inactive(seat, new_sibling); | ||
731 | // Use the focused child of the tabbed/stacked container, not the | 730 | // Use the focused child of the tabbed/stacked container, not the |
732 | // container the user scrolled on. | 731 | // container the user scrolled on. |
733 | seat_set_focus(seat, new_focus); | 732 | new_focus = seat_get_focus_inactive(seat, new_sibling); |
734 | transaction_commit_dirty(); | 733 | } else { |
735 | handled = true; | 734 | new_focus = seat_get_focus_inactive(seat, &cont->node); |
736 | } | 735 | } |
736 | |||
737 | seat_set_focus(seat, new_focus); | ||
738 | transaction_commit_dirty(); | ||
739 | handled = true; | ||
737 | } | 740 | } |
738 | 741 | ||
739 | // Handle mouse bindings - x11 mouse buttons 4-7 - release event | 742 | // Handle mouse bindings - x11 mouse buttons 4-7 - release event |