diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-02-20 14:08:20 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-02-20 20:17:45 +0100 |
commit | 546b976baa9989676c2fb2aff8c36f42b3d19810 (patch) | |
tree | 679da80a1cdfb51fc27593282cc4ed22ebe1b007 | |
parent | Merge pull request #3735 from emersion/primary-selection-v1 (diff) | |
download | sway-546b976baa9989676c2fb2aff8c36f42b3d19810.tar.gz sway-546b976baa9989676c2fb2aff8c36f42b3d19810.tar.zst sway-546b976baa9989676c2fb2aff8c36f42b3d19810.zip |
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) { | |||
189 | continue; | 189 | continue; |
190 | } | 190 | } |
191 | 191 | ||
192 | struct sway_workspace *new_output_ws = | ||
193 | output_get_active_workspace(new_output); | ||
194 | |||
192 | workspace_output_add_priority(workspace, new_output); | 195 | workspace_output_add_priority(workspace, new_output); |
193 | output_add_workspace(new_output, workspace); | 196 | output_add_workspace(new_output, workspace); |
194 | output_sort_workspaces(new_output); | 197 | output_sort_workspaces(new_output); |
195 | ipc_event_workspace(NULL, workspace, "move"); | 198 | ipc_event_workspace(NULL, workspace, "move"); |
199 | |||
200 | // If there is an old workspace (the noop output may not have one), | ||
201 | // check to see if it is empty and should be destroyed. | ||
202 | if (new_output_ws) { | ||
203 | workspace_consider_destroy(new_output_ws); | ||
204 | } | ||
196 | } | 205 | } |
197 | } | 206 | } |
198 | 207 | ||