mirror of
https://github.com/swaywm/sway.git
synced 2024-11-23 00:11:28 +00:00
Merge pull request #2886 from RyanDwyer/fix-headless-unmap-crash
Fix crash when view unmaps while no outputs connected
This commit is contained in:
commit
fe6aea1d02
|
@ -89,6 +89,7 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(ws_name);
|
free(ws_name);
|
||||||
|
ipc_event_workspace(NULL, ws, "init");
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t len = sizeof(output->layers) / sizeof(output->layers[0]);
|
size_t len = sizeof(output->layers) / sizeof(output->layers[0]);
|
||||||
|
|
|
@ -119,6 +119,11 @@ void workspace_begin_destroy(struct sway_workspace *workspace) {
|
||||||
|
|
||||||
if (workspace->output) {
|
if (workspace->output) {
|
||||||
workspace_detach(workspace);
|
workspace_detach(workspace);
|
||||||
|
} else {
|
||||||
|
int index = list_find(root->saved_workspaces, workspace);
|
||||||
|
if (index != -1) {
|
||||||
|
list_del(root->saved_workspaces, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
workspace->node.destroying = true;
|
workspace->node.destroying = true;
|
||||||
|
@ -126,10 +131,13 @@ void workspace_begin_destroy(struct sway_workspace *workspace) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void workspace_consider_destroy(struct sway_workspace *ws) {
|
void workspace_consider_destroy(struct sway_workspace *ws) {
|
||||||
if (ws->tiling->length == 0 && ws->floating->length == 0
|
if (ws->tiling->length || ws->floating->length) {
|
||||||
&& output_get_active_workspace(ws->output) != ws) {
|
return;
|
||||||
workspace_begin_destroy(ws);
|
|
||||||
}
|
}
|
||||||
|
if (ws->output && output_get_active_workspace(ws->output) == ws) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
workspace_begin_destroy(ws);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *prev_workspace_name = NULL;
|
char *prev_workspace_name = NULL;
|
||||||
|
|
Loading…
Reference in a new issue