]> git.sur5r.net Git - i3/i3/commitdiff
correctly focus workspaces
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 13 Apr 2010 14:41:23 +0000 (16:41 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 13 Apr 2010 14:41:23 +0000 (16:41 +0200)
src/tree.c
src/workspace.c

index 1d5405fde0e04866cc52e249da297c0091efedf6..22dcf5cc8b29e761e63fbaf1eeabc17f16b2a729 100644 (file)
@@ -275,7 +275,7 @@ void tree_next(char way, orientation_t orientation) {
     /* 3: focus choice comes in here. at the moment we will go down
      * until we find a window */
     /* TODO: check for window, atm we only go down as far as possible */
-    while (TAILQ_FIRST(&(next->focus_head)) != TAILQ_END(&(next->focus_head)))
+    while (!TAILQ_EMPTY(&(next->focus_head)))
         next = TAILQ_FIRST(&(next->focus_head));
 
     con_focus(next);
index d65a5198ace33ca6dffe9c8b4007b0d7c81d92e3..63e079f90f1ff463861d2ab118878003a6bf496e 100644 (file)
@@ -110,7 +110,12 @@ void workspace_show(const char *num) {
                 current->fullscreen_mode = CF_NONE;
 
         LOG("switching to %p\n", workspace);
-        con_focus(workspace);
+        Con *next = workspace;
+
+    while (!TAILQ_EMPTY(&(next->focus_head)))
+        next = TAILQ_FIRST(&(next->focus_head));
+
+        con_focus(next);
         workspace->fullscreen_mode = CF_OUTPUT;
         LOG("focused now = %p / %s\n", focused, focused->name);
 #if 0