diff options
-rw-r--r-- | sway/desktop/transaction.c | 12 | ||||
-rw-r--r-- | sway/tree/container.c | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 1316a80d..145c5f92 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -121,7 +121,17 @@ static void copy_pending_state(struct sway_container *container, | |||
121 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 121 | struct sway_seat *seat = input_manager_current_seat(input_manager); |
122 | state->focused = seat_get_focus(seat) == container; | 122 | state->focused = seat_get_focus(seat) == container; |
123 | 123 | ||
124 | if (container->type != C_VIEW) { | 124 | if (container->type == C_WORKSPACE) { |
125 | // Set focused_inactive_child to the direct tiling child | ||
126 | struct sway_container *focus = | ||
127 | seat_get_focus_inactive_tiling(seat, container); | ||
128 | if (focus && focus->type > C_WORKSPACE) { | ||
129 | while (focus->parent->type != C_WORKSPACE) { | ||
130 | focus = focus->parent; | ||
131 | } | ||
132 | } | ||
133 | state->focused_inactive_child = focus; | ||
134 | } else if (container->type != C_VIEW) { | ||
125 | state->focused_inactive_child = | 135 | state->focused_inactive_child = |
126 | seat_get_active_child(seat, container); | 136 | seat_get_active_child(seat, container); |
127 | } | 137 | } |
diff --git a/sway/tree/container.c b/sway/tree/container.c index ee019098..520b4566 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -173,6 +173,9 @@ struct sway_container *container_reap_empty(struct sway_container *con) { | |||
173 | } | 173 | } |
174 | if (con && con->type == C_WORKSPACE) { | 174 | if (con && con->type == C_WORKSPACE) { |
175 | workspace_consider_destroy(con); | 175 | workspace_consider_destroy(con); |
176 | if (con->destroying) { | ||
177 | con = con->parent; | ||
178 | } | ||
176 | } | 179 | } |
177 | return con; | 180 | return con; |
178 | } | 181 | } |