diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-08-27 12:32:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-27 12:32:29 -0400 |
commit | 9d9de97c4c31b420b337fb7d6878297fcca95562 (patch) | |
tree | 421a57e6b84e493dd506daf4eed354545835ea0e | |
parent | efcaee190e9aed20f27269e195af3091fd18f145 (diff) | |
parent | 148b113b8d0df71fa20f6a269118624f7d29fb49 (diff) | |
download | sway-9d9de97c4c31b420b337fb7d6878297fcca95562.tar.xz |
Merge pull request #2520 from RedSoxFan/destroy-empty-ws-on-evac
Destroy empty workspaces in output_evacuate
-rw-r--r-- | sway/tree/output.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c index bfc9c723..6601220b 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -128,14 +128,19 @@ static void output_evacuate(struct sway_container *output) { while (output->children->length) { struct sway_container *workspace = output->children->items[0]; + container_remove_child(workspace); + + if (workspace_is_empty(workspace)) { + workspace_begin_destroy(workspace); + continue; + } + struct sway_container *new_output = workspace_output_get_highest_available(workspace, output); if (!new_output) { new_output = fallback_output; } - container_remove_child(workspace); - if (new_output) { workspace_output_add_priority(workspace, new_output); container_add_child(new_output, workspace); |