From 948378fa554815c4b010e5e939334e4430806507 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 28 Jun 2010 22:37:35 +0200 Subject: [PATCH] floating: correctly kill floating containers when closing --- src/tree.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tree.c b/src/tree.c index a6f3dc13..d3e83875 100644 --- a/src/tree.c +++ b/src/tree.c @@ -174,6 +174,14 @@ void tree_close(Con *con, bool kill_window) { con_detach(con); con_fix_percent(con->parent, WINDOW_REMOVE); + if (con_is_floating(con)) { + DLOG("Container was floating, killing floating container\n"); + + TAILQ_REMOVE(&(con->parent->parent->floating_head), con->parent, floating_windows); + TAILQ_REMOVE(&(con->parent->parent->focus_head), con->parent, focused); + tree_close(con->parent, false); + } + free(con->name); TAILQ_REMOVE(&all_cons, con, all_cons); free(con); -- 2.39.5