X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Frender.c;h=7ada19ebdc37d76546c4156eef839fe4a35e8919;hb=14a4e0c6f8500b981ed36b3e772c65c3ca35749d;hp=ed35eb0c3c0f0772ddf2c6da8472b0e0d1594aa1;hpb=a6c6e3e3a0efdcc5423a876fff22525b5da378c3;p=i3%2Fi3 diff --git a/src/render.c b/src/render.c index ed35eb0c..7ada19eb 100644 --- a/src/render.c +++ b/src/render.c @@ -4,7 +4,7 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * * render.c: Renders (determines position/sizes) the layout tree, updating the * various rects. Needs to be pushed to X11 (see x.c) to be visible. @@ -154,7 +154,7 @@ void render_con(Con *con, bool render_fullscreen) { /* depending on the border style, the rect of the child window * needs to be smaller */ Rect *inset = &(con->window_rect); - *inset = (Rect) {0, 0, con->rect.width, con->rect.height}; + *inset = (Rect){0, 0, con->rect.width, con->rect.height}; if (!render_fullscreen) *inset = rect_add(*inset, con_border_style_rect(con)); @@ -172,14 +172,14 @@ void render_con(Con *con, bool render_fullscreen) { * Ignoring aspect ratio during fullscreen was necessary to fix MPlayer * subtitle rendering, see http://bugs.i3wm.org/594 */ if (!render_fullscreen && - con->aspect_ratio > 0.0) { + con->window->aspect_ratio > 0.0) { DLOG("aspect_ratio = %f, current width/height are %d/%d\n", - con->aspect_ratio, inset->width, inset->height); + con->window->aspect_ratio, inset->width, inset->height); double new_height = inset->height + 1; int new_width = inset->width; while (new_height > inset->height) { - new_height = (1.0 / con->aspect_ratio) * new_width; + new_height = (1.0 / con->window->aspect_ratio) * new_width; if (new_height > inset->height) new_width--; @@ -210,7 +210,15 @@ void render_con(Con *con, bool render_fullscreen) { fullscreen->rect = rect; x_raise_con(fullscreen); render_con(fullscreen, true); - return; + /* Fullscreen containers are either global (underneath the CT_ROOT + * container) or per-output (underneath the CT_CONTENT container). For + * global fullscreen containers, we cannot abort rendering here yet, + * because the floating windows (with popup_during_fullscreen smart) + * have not yet been rendered (see the CT_ROOT code path below). See + * also http://bugs.i3wm.org/1393 */ + if (con->type != CT_ROOT) { + return; + } } /* find the height for the decorations */ @@ -247,8 +255,10 @@ void render_con(Con *con, bool render_fullscreen) { render_l_output(con); } else if (con->type == CT_ROOT) { Con *output; - TAILQ_FOREACH(output, &(con->nodes_head), nodes) { - render_con(output, false); + if (!fullscreen) { + TAILQ_FOREACH(output, &(con->nodes_head), nodes) { + render_con(output, false); + } } /* We need to render floating windows after rendering all outputs’ @@ -288,6 +298,8 @@ void render_con(Con *con, bool render_fullscreen) { while (transient_con != NULL && transient_con->window != NULL && transient_con->window->transient_for != XCB_NONE) { + DLOG("transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n", + transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id); if (transient_con->window->transient_for == fullscreen->window->id) { is_transient_for = true; break;