Bugfix: Render floating windows after rendering all outputs (Thanks mw)

Fixes #548

See the comment on why this is necessary.
This commit is contained in:
Michael Stapelberg 2011-11-10 20:30:51 +00:00
parent df095f9d68
commit b808cc5d18

View File

@ -221,10 +221,29 @@ void render_con(Con *con, bool render_fullscreen) {
if (con->layout == L_OUTPUT) { if (con->layout == L_OUTPUT) {
render_l_output(con); render_l_output(con);
} else if (con->type == CT_ROOT) { } else if (con->type == CT_ROOT) {
Con *child; Con *output;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) { TAILQ_FOREACH(output, &(con->nodes_head), nodes) {
render_con(child, false); render_con(output, false);
} }
/* We need to render floating windows after rendering all outputs
* tiling windows because they need to be on top of *every* output at
* all times. This is important when the user places floating
* windows/containers so that they overlap on another output. */
DLOG("Rendering floating windows:\n");
TAILQ_FOREACH(output, &(con->nodes_head), nodes) {
/* Get the active workspace of that output */
Con *content = output_get_content(output);
Con *workspace = TAILQ_FIRST(&(content->focus_head));
Con *child;
TAILQ_FOREACH(child, &(workspace->floating_head), floating_windows) {
DLOG("floating child at (%d,%d) with %d x %d\n", child->rect.x, child->rect.y, child->rect.width, child->rect.height);
x_raise_con(child);
render_con(child, false);
}
}
} else { } else {
/* FIXME: refactor this into separate functions: */ /* FIXME: refactor this into separate functions: */
@ -339,11 +358,4 @@ void render_con(Con *con, bool render_fullscreen) {
x_raise_con(con); x_raise_con(con);
} }
} }
Con *child;
TAILQ_FOREACH(child, &(con->floating_head), floating_windows) {
DLOG("floating child at (%d,%d) with %d x %d\n", child->rect.x, child->rect.y, child->rect.width, child->rect.height);
x_raise_con(child);
render_con(child, false);
}
} }