traverse numbered workspaces in correct order

This commit is contained in:
Benedikt Heine 2016-07-09 12:56:06 +02:00
parent b668d62cfc
commit d979748853
1 changed files with 2 additions and 2 deletions

View File

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