diff options
-rw-r--r-- | sway/handlers.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 3a4e31ae..b5e0a0e1 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -227,7 +227,17 @@ static void handle_view_destroyed(wlc_handle handle) { | |||
227 | locked_container_focus = false; | 227 | locked_container_focus = false; |
228 | break; | 228 | break; |
229 | } | 229 | } |
230 | set_focused_container(get_focused_view(&root_container)); | 230 | |
231 | swayc_t *focused_view = get_focused_view(&root_container); | ||
232 | if(focused_view->type == C_WORKSPACE && focused_view->children->length == 0){ | ||
233 | sway_log(L_DEBUG, "we are here first"); | ||
234 | if(focused_view->floating->length > 0){ | ||
235 | sway_log(L_DEBUG, "we are here %d", focused_view->floating->length); | ||
236 | focused_view = focused_view->floating->items[focused_view->floating->length-1]; | ||
237 | focused_view = get_focused_view(focused_view); | ||
238 | } | ||
239 | } | ||
240 | set_focused_container(focused_view); | ||
231 | } | 241 | } |
232 | 242 | ||
233 | static void handle_view_focus(wlc_handle view, bool focus) { | 243 | static void handle_view_focus(wlc_handle view, bool focus) { |