]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Look for cons to focus *starting* at the ws, not beneath the ws (Thanks mseed)
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 7 Jan 2011 23:10:49 +0000 (00:10 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 7 Jan 2011 23:10:49 +0000 (00:10 +0100)
This should fix #286.

src/tree.c

index aa55b29aa6e2d288131ccf0df6973b6fd4d18378..b601cdd49fecfbb756879587e167d7a296985cac 100644 (file)
@@ -177,7 +177,12 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) {
         DLOG("parent container killed\n");
         if (con == focused) {
             DLOG("This is the focused container, i need to find another one to focus. I start looking at ws = %p\n", ws);
-            next = con_next_focused(ws);
+            next = ws;
+            /* now go down the focus stack as far as
+             * possible, excluding the current container */
+            while (!TAILQ_EMPTY(&(next->focus_head)))
+                next = TAILQ_FIRST(&(next->focus_head));
+
             dont_kill_parent = true;
             DLOG("Alright, focusing %p\n", next);
         } else {