From bfe8649e90eb88a52a31cf83bc2750895fddf3f9 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 16 Oct 2017 21:07:55 -0400 Subject: [PATCH] Fix crash closing fullscreen windows in container --- sway/handlers.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sway/handlers.c b/sway/handlers.c index d37142a9b..6ccf2b11a 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -554,10 +554,6 @@ static void handle_view_destroyed(wlc_handle handle) { remove_view_from_scratchpad(view); swayc_t *parent = destroy_view(view); if (parent) { - if (fullscreen) { - parent->fullscreen = NULL; - } - ipc_event_window(parent, "close"); // Destroy empty workspaces @@ -569,6 +565,17 @@ static void handle_view_destroyed(wlc_handle handle) { parent = destroy_workspace(parent); } + if (fullscreen) { + while (parent) { + if (parent->fullscreen) { + parent->fullscreen = NULL; + break; + } + parent = parent->parent; + } + } + + arrange_windows(parent, -1, -1); } } else {