aboutsummaryrefslogtreecommitdiff
path: root/sway/focus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/focus.c')
-rw-r--r--sway/focus.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/focus.c b/sway/focus.c
index 9f070866..ca56de4b 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -37,7 +37,11 @@ static void update_focus(swayc_t *c) {
ipc_event_workspace(prev, c);
// update visibility of old workspace
update_visibility(prev);
- destroy_workspace(prev);
+
+ // if the old workspace has no children, destroy it
+ if(prev->children->length == 0 && prev->floating->length == 0){
+ destroy_workspace(prev);
+ }
}
// Update visibility of newly focused workspace
update_visibility(c);