]> git.sur5r.net Git - i3/i3/commitdiff
traverse numbered workspaces in correct order
authorBenedikt Heine <bebe@bebehei.de>
Sat, 9 Jul 2016 10:56:06 +0000 (12:56 +0200)
committerBenedikt Heine <bebe@bebehei.de>
Wed, 24 Aug 2016 09:11:50 +0000 (11:11 +0200)
src/workspace.c

index f8d15ba1f09cccad3872e9d39ee2ae52ab1e8599..b0d5977388cd9fb1cbd703af5a0476cb8f6b8df3 100644 (file)
@@ -544,7 +544,7 @@ Con *workspace_next(void) {
             NODES_FOREACH(output_get_content(output)) {
                 if (child->type != CT_WORKSPACE)
                     continue;
-                if (!first)
+                if (!first || (child->num != -1 && child->num < first->num))
                     first = child;
                 if (!first_opposite && child->num == -1)
                     first_opposite = child;
@@ -610,7 +610,7 @@ Con *workspace_prev(void) {
             NODES_FOREACH_REVERSE(output_get_content(output)) {
                 if (child->type != CT_WORKSPACE)
                     continue;
-                if (!last)
+                if (!last || (child->num != -1 && last->num < child->num))
                     last = child;
                 if (!first_opposite && child->num == -1)
                     first_opposite = child;