aboutsummaryrefslogtreecommitdiff
path: root/sway/focus.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-13 12:28:04 -0500
committerDrew DeVault <sir@cmpwn.com>2015-12-13 12:28:04 -0500
commitc0f75f68b9e7bb71eb2792fb84e5ff34a8ecadbb (patch)
tree19bf02314f732916aeb78d422877f7706e75d82e /sway/focus.c
parent6596582bc381d371f0e355d61595b2b87b5ee821 (diff)
parentd77d03ce8419f83553d322eb5dd08412a45b7bb3 (diff)
Merge pull request #302 from fluxchief/destroy-workspace-fix
Make destroy_workspace behave as expected
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);