diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/output.c | 1 | ||||
-rw-r--r-- | sway/tree/workspace.c | 14 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c index c3176325..98041c47 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -89,6 +89,7 @@ void output_enable(struct sway_output *output, struct output_config *oc) { | |||
89 | } | 89 | } |
90 | } | 90 | } |
91 | free(ws_name); | 91 | free(ws_name); |
92 | ipc_event_workspace(NULL, ws, "init"); | ||
92 | } | 93 | } |
93 | 94 | ||
94 | size_t len = sizeof(output->layers) / sizeof(output->layers[0]); | 95 | size_t len = sizeof(output->layers) / sizeof(output->layers[0]); |
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 | ||
128 | void workspace_consider_destroy(struct sway_workspace *ws) { | 133 | void 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 | ||
135 | char *prev_workspace_name = NULL; | 143 | char *prev_workspace_name = NULL; |