diff --git a/sway/tree/container.c b/sway/tree/container.c index 6880841bd..32e0d6ff7 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -481,6 +481,12 @@ void container_begin_destroy(struct sway_container *con) { if (con->pending.fullscreen_mode == FULLSCREEN_WORKSPACE && con->pending.workspace) { con->pending.workspace->fullscreen = NULL; } + + // If the container was the one stored in the overview's fullscreen memory, clear it. + if (con->pending.workspace && con->pending.workspace->layout.fullscreen == con) { + con->pending.workspace->layout.fullscreen = NULL; + } + if (con->scratchpad && con->pending.fullscreen_mode == FULLSCREEN_GLOBAL) { container_fullscreen_disable(con); }