mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 21:14:10 +01:00
Merge pull request #2414 from RyanDwyer/fix-inactive-fullscreen-crash
Fix crash when fullscreen view closes on inactive workspace
This commit is contained in:
commit
b49904dd7e
@ -592,19 +592,18 @@ void view_unmap(struct sway_view *view) {
|
|||||||
view->urgent_timer = NULL;
|
view->urgent_timer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
|
bool was_fullscreen = view->swayc->is_fullscreen;
|
||||||
|
struct sway_container *surviving_ancestor = container_destroy(view->swayc);
|
||||||
|
|
||||||
struct sway_container *parent;
|
// If the workspace wasn't reaped
|
||||||
if (container_is_fullscreen_or_child(view->swayc)) {
|
if (surviving_ancestor->type >= C_WORKSPACE) {
|
||||||
parent = container_destroy(view->swayc);
|
struct sway_container *ws = surviving_ancestor->type == C_WORKSPACE ?
|
||||||
arrange_windows(ws->parent);
|
surviving_ancestor :
|
||||||
} else {
|
container_parent(surviving_ancestor, C_WORKSPACE);
|
||||||
parent = container_destroy(view->swayc);
|
arrange_windows(was_fullscreen ? ws : surviving_ancestor);
|
||||||
arrange_windows(parent);
|
|
||||||
}
|
|
||||||
if (parent->type >= C_WORKSPACE) { // if the workspace still exists
|
|
||||||
workspace_detect_urgent(ws);
|
workspace_detect_urgent(ws);
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction_commit_dirty();
|
transaction_commit_dirty();
|
||||||
view->surface = NULL;
|
view->surface = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user