diff options
-rw-r--r-- | sway/handlers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index d3fbdc0f..69f325eb 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -303,6 +303,16 @@ static void handle_view_destroyed(wlc_handle handle) { | |||
303 | if (fullscreen) { | 303 | if (fullscreen) { |
304 | parent->fullscreen = NULL; | 304 | parent->fullscreen = NULL; |
305 | } | 305 | } |
306 | |||
307 | // Destroy empty workspaces | ||
308 | if (parent->type == C_WORKSPACE && | ||
309 | parent->children->length == 0 && | ||
310 | parent->floating->length == 0 && | ||
311 | swayc_active_workspace() != parent && | ||
312 | !parent->visible) { | ||
313 | parent = destroy_workspace(parent); | ||
314 | } | ||
315 | |||
306 | arrange_windows(parent, -1, -1); | 316 | arrange_windows(parent, -1, -1); |
307 | } else { | 317 | } else { |
308 | // Is it unmanaged? | 318 | // Is it unmanaged? |