]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Even when not going one level up, we need to travel down the whole focus...
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Jul 2010 13:08:22 +0000 (15:08 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Jul 2010 13:08:22 +0000 (15:08 +0200)
src/con.c

index 4eeaf13cce042315ab8042be3622ca1c16a2f894..4b0b2307dffc75ed929e684df6636df9f5567bd6 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -418,14 +418,15 @@ Con *con_next_focused(Con *con) {
     /* try to focus the next container on the same level as this one */
     next = TAILQ_NEXT(con, focused);
 
-    /* if none, go up to its parent and go down the focus stack as far as
-     * possible, excluding the current container */
-    if (next == TAILQ_END(&(parent->nodes_head))) {
+    /* if that was not possible, go up to its parent */
+    if (next == TAILQ_END(&(parent->nodes_head)))
         next = con->parent;
-        while (!TAILQ_EMPTY(&(next->focus_head)) &&
-               TAILQ_FIRST(&(next->focus_head)) != con)
-            next = TAILQ_FIRST(&(next->focus_head));
-    }
+
+    /* now go down the focus stack as far as
+     * possible, excluding the current container */
+    while (!TAILQ_EMPTY(&(next->focus_head)) &&
+           TAILQ_FIRST(&(next->focus_head)) != con)
+        next = TAILQ_FIRST(&(next->focus_head));
 
     return next;
 }