rendering: bugfix: stack child windows of stacked/tabbed cons according to their focus

fixes focusing the wrong window after closing a con
This commit is contained in:
Michael Stapelberg 2011-03-06 21:49:17 +01:00
parent 4f26316aaa
commit b0b195318c
1 changed files with 11 additions and 7 deletions

View File

@ -323,13 +323,17 @@ void render_con(Con *con, bool render_fullscreen) {
/* in a stacking or tabbed container, we ensure the focused client is raised */ /* in a stacking or tabbed container, we ensure the focused client is raised */
if (con->layout == L_STACKED || con->layout == L_TABBED) { if (con->layout == L_STACKED || con->layout == L_TABBED) {
Con *foc = TAILQ_FIRST(&(con->focus_head)); DLOG("stacked/tabbed, raising focused reverse\n");
if (foc != TAILQ_END(&(con->focus_head))) { TAILQ_FOREACH_REVERSE(child, &(con->focus_head), focus_head, focused)
DLOG("con %p is stacking, raising %p\n", con, foc); x_raise_con(child);
x_raise_con(foc); DLOG("done\n");
/* by rendering the stacked container again, we handle the case if ((child = TAILQ_FIRST(&(con->focus_head)))) {
* that we have a non-leaf-container inside the stack. */ DLOG("con %p is stacking, raising %p\n", con, child);
render_con(foc, false); /* By rendering the stacked container again, we handle the case
* that we have a non-leaf-container inside the stack. In that
* case, the children of the non-leaf-container need to be raised
* aswell. */
render_con(child, false);
} }
} }
} }