Make destroy_workspace behave as expected

This commit is contained in:
Kevin Hamacher 2015-12-13 18:19:24 +01:00
parent 6596582bc3
commit d77d03ce84
2 changed files with 31 additions and 9 deletions

View file

@ -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);