diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2019-02-20 14:08:20 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2019-02-20 14:08:20 -0500 |
| commit | 934b0c7f2eb79d92b6b13a17180c6771423c0483 (patch) | |
| tree | b7d75a15fb91bc08b66d00b934a35871a6b52f40 | |
| parent | 256631030c6abcb485b1d0901709c4905445771f (diff) | |
output_evacuate: call workspace_consider_destroy
This calls `workspace_consider_destroy` on the workspace that was
visible on an output that a workspace was just evacuated to. This
prevents having hidden empty workspaces.
| -rw-r--r-- | sway/tree/output.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c index 60e0af9f..146bc423 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -189,10 +189,19 @@ static void output_evacuate(struct sway_output *output) { continue; } + struct sway_workspace *new_output_ws = + output_get_active_workspace(new_output); + workspace_output_add_priority(workspace, new_output); output_add_workspace(new_output, workspace); output_sort_workspaces(new_output); ipc_event_workspace(NULL, workspace, "move"); + + // If there is an old workspace (the noop output may not have one), + // check to see if it is empty and should be destroyed. + if (new_output_ws) { + workspace_consider_destroy(new_output_ws); + } } } |
