mirror of
https://github.com/swaywm/sway.git
synced 2024-11-16 21:23:17 +00:00
Fix potential crash when fullscreen view unmaps
It happened when a view is a grandchild or deeper of the workspace, is fullscreen, and unmaps. The workspace would not be included in the transaction and its pointer to the fullscreen view was left dangling.
This commit is contained in:
parent
c371ff3de8
commit
9b15e81cff
|
@ -542,14 +542,16 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
|
||||||
struct sway_container *view_unmap(struct sway_view *view) {
|
struct sway_container *view_unmap(struct sway_view *view) {
|
||||||
wl_signal_emit(&view->events.unmap, view);
|
wl_signal_emit(&view->events.unmap, view);
|
||||||
|
|
||||||
|
wl_list_remove(&view->surface_new_subsurface.link);
|
||||||
|
wl_list_remove(&view->container_reparent.link);
|
||||||
|
|
||||||
if (view->is_fullscreen) {
|
if (view->is_fullscreen) {
|
||||||
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
|
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
|
||||||
ws->sway_workspace->fullscreen = NULL;
|
ws->sway_workspace->fullscreen = NULL;
|
||||||
|
container_destroy(view->swayc);
|
||||||
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_list_remove(&view->surface_new_subsurface.link);
|
|
||||||
wl_list_remove(&view->container_reparent.link);
|
|
||||||
|
|
||||||
return container_destroy(view->swayc);
|
return container_destroy(view->swayc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue