X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcon.c;h=ad5025a92057aa10aa16d4916065f42fcf884183;hb=2bf7793d4d241efca25c452b5c8a5897b2a29da3;hp=609a0d36990a0f36a6cccf272299ca22722ddfa2;hpb=ca77c12dde4284cbca0bcb7f91344cad1a691c43;p=i3%2Fi3 diff --git a/src/con.c b/src/con.c index 609a0d36..ad5025a9 100644 --- a/src/con.c +++ b/src/con.c @@ -1005,6 +1005,7 @@ Con *con_descend_tiling_focused(Con *con) { */ Con *con_descend_direction(Con *con, direction_t direction) { Con *most = NULL; + Con *current; int orientation = con_orientation(con); DLOG("con_descend_direction(%p, orientation %d, direction %d)\n", con, orientation, direction); if (direction == D_LEFT || direction == D_RIGHT) { @@ -1018,7 +1019,12 @@ Con *con_descend_direction(Con *con, direction_t direction) { /* Wrong orientation. We use the last focused con. Within that con, * we recurse to chose the left/right con or at least the last * focused one. */ - most = TAILQ_FIRST(&(con->focus_head)); + TAILQ_FOREACH(current, &(con->focus_head), focused) { + if (current->type != CT_FLOATING_CON) { + most = current; + break; + } + } } else { /* If the con has no orientation set, it’s not a split container * but a container with a client window, so stop recursing */ @@ -1037,7 +1043,12 @@ Con *con_descend_direction(Con *con, direction_t direction) { /* Wrong orientation. We use the last focused con. Within that con, * we recurse to chose the top/bottom con or at least the last * focused one. */ - most = TAILQ_FIRST(&(con->focus_head)); + TAILQ_FOREACH(current, &(con->focus_head), focused) { + if (current->type != CT_FLOATING_CON) { + most = current; + break; + } + } } else { /* If the con has no orientation set, it’s not a split container * but a container with a client window, so stop recursing */