- Con *next;
- if (con->type == CT_FLOATING_CON) {
- next = TAILQ_NEXT(con, floating_windows);
- if (next == TAILQ_END(&(con->parent->floating_head)))
- next = con_get_workspace(con);
- } else {
- next = TAILQ_NEXT(con, focused);
- if (next == TAILQ_END(&(con->parent->nodes_head))) {
- next = con->parent;
- while (!TAILQ_EMPTY(&(next->focus_head)) &&
- TAILQ_FIRST(&(next->focus_head)) != con)
- next = TAILQ_FIRST(&(next->focus_head));
- }
- }