sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 546b976baa9989676c2fb2aff8c36f42b3d19810
parent b57761e833f0198d2bd9ac95b1926cc5b08d6ac3
Author: Brian Ashworth <bosrsf04@gmail.com>
Date:   Wed, 20 Feb 2019 14:08:20 -0500

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.

Diffstat:
Msway/tree/output.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git 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); + } } }