diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-29 10:38:46 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-29 10:38:46 +1000 |
commit | 53fe7b02e9787e8a08dbc4d132e8bde836647a9e (patch) | |
tree | d82c74c736bfb0f9d86f6449f43006e1ea6344d8 | |
parent | Merge pull request #2526 from ianyfan/commands (diff) | |
download | sway-53fe7b02e9787e8a08dbc4d132e8bde836647a9e.tar.gz sway-53fe7b02e9787e8a08dbc4d132e8bde836647a9e.tar.zst sway-53fe7b02e9787e8a08dbc4d132e8bde836647a9e.zip |
Fix workspace tabs
When collecting focus to save into the transaction state, the workspace
needs to look in the tiling list only.
As seat_get_focus_inactive_tiling returns any descendant, the list also
needs to be traversed back up to the direct child of the workspace.
Fixes #2532
-rw-r--r-- | sway/desktop/transaction.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index c18529fb..862ffee8 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -122,7 +122,17 @@ static void copy_pending_state(struct sway_container *container, | |||
122 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 122 | struct sway_seat *seat = input_manager_current_seat(input_manager); |
123 | state->focused = seat_get_focus(seat) == container; | 123 | state->focused = seat_get_focus(seat) == container; |
124 | 124 | ||
125 | if (container->type != C_VIEW) { | 125 | if (container->type == C_WORKSPACE) { |
126 | // Set focused_inactive_child to the direct tiling child | ||
127 | struct sway_container *focus = | ||
128 | seat_get_focus_inactive_tiling(seat, container); | ||
129 | if (focus && focus->type == C_CONTAINER) { | ||
130 | while (focus->parent->type != C_WORKSPACE) { | ||
131 | focus = focus->parent; | ||
132 | } | ||
133 | } | ||
134 | state->focused_inactive_child = focus; | ||
135 | } else if (container->type != C_VIEW) { | ||
126 | state->focused_inactive_child = | 136 | state->focused_inactive_child = |
127 | seat_get_active_child(seat, container); | 137 | seat_get_active_child(seat, container); |
128 | } | 138 | } |