Bugfix: Open new windows in the correct place when assignments match (+test) (Thanks Don)

This commit is contained in:
Michael Stapelberg
2012-01-07 18:50:00 +00:00
parent 313a700e86
commit d4238c778a
2 changed files with 55 additions and 2 deletions

View File

@ -808,7 +808,7 @@ Con *con_get_next(Con *con, char way, orientation_t orientation) {
*/
Con *con_descend_focused(Con *con) {
Con *next = con;
while (!TAILQ_EMPTY(&(next->focus_head)))
while (next != focused && !TAILQ_EMPTY(&(next->focus_head)))
next = TAILQ_FIRST(&(next->focus_head));
return next;
}
@ -825,6 +825,8 @@ Con *con_descend_tiling_focused(Con *con) {
Con *next = con;
Con *before;
Con *child;
if (next == focused)
return next;
do {
before = next;
TAILQ_FOREACH(child, &(next->focus_head), focused) {
@ -834,7 +836,7 @@ Con *con_descend_tiling_focused(Con *con) {
next = child;
break;
}
} while (before != next);
} while (before != next && next != focused);
return next;
}