summaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 2a00824d..ed875ebb 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -119,6 +119,11 @@ void workspace_begin_destroy(struct sway_workspace *workspace) {
119 119
120 if (workspace->output) { 120 if (workspace->output) {
121 workspace_detach(workspace); 121 workspace_detach(workspace);
122 } else {
123 int index = list_find(root->saved_workspaces, workspace);
124 if (index != -1) {
125 list_del(root->saved_workspaces, index);
126 }
122 } 127 }
123 128
124 workspace->node.destroying = true; 129 workspace->node.destroying = true;
@@ -126,10 +131,13 @@ void workspace_begin_destroy(struct sway_workspace *workspace) {
126} 131}
127 132
128void workspace_consider_destroy(struct sway_workspace *ws) { 133void workspace_consider_destroy(struct sway_workspace *ws) {
129 if (ws->tiling->length == 0 && ws->floating->length == 0 134 if (ws->tiling->length || ws->floating->length) {
130 && output_get_active_workspace(ws->output) != ws) { 135 return;
131 workspace_begin_destroy(ws); 136 }
137 if (ws->output && output_get_active_workspace(ws->output) == ws) {
138 return;
132 } 139 }
140 workspace_begin_destroy(ws);
133} 141}
134 142
135char *prev_workspace_name = NULL; 143char *prev_workspace_name = NULL;