From d77d03ce8419f83553d322eb5dd08412a45b7bb3 Mon Sep 17 00:00:00 2001 From: Kevin Hamacher Date: Sun, 13 Dec 2015 18:19:24 +0100 Subject: Make destroy_workspace behave as expected --- sway/focus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sway/focus.c') 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); -- cgit v1.2.3