diff options
author | Nicklas Warming Jacobsen <nicklaswj@gmail.com> | 2015-08-25 20:15:23 +0200 |
---|---|---|
committer | Nicklas Warming Jacobsen <nicklaswj@gmail.com> | 2015-08-25 20:15:23 +0200 |
commit | 7a1c36716aa1248fc6410df8fddb6702dfa99c0f (patch) | |
tree | 6c7efea5390e43aa11d9fa4a3299b4f65ad2fe15 | |
parent | Merge pull request #125 from Luminarys/master (diff) | |
download | sway-7a1c36716aa1248fc6410df8fddb6702dfa99c0f.tar.gz sway-7a1c36716aa1248fc6410df8fddb6702dfa99c0f.tar.zst sway-7a1c36716aa1248fc6410df8fddb6702dfa99c0f.zip |
Focus floating window, if any, when the last tiling has been closed
-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) { |