]> git.sur5r.net Git - i3/i3/commitdiff
floating: correctly kill floating containers when closing
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 28 Jun 2010 20:37:35 +0000 (22:37 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 28 Jun 2010 20:37:35 +0000 (22:37 +0200)
src/tree.c

index a6f3dc138933a07b2e5b5219f033bfbddbace69b..d3e8387534a098a6b15a23ac5950e9ee70172b0b 100644 (file)
@@ -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);