From 2d280469af8fae2b504ffe5a0c71894dd2f02c8a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 21 Nov 2010 17:00:10 +0100 Subject: [PATCH] =?utf8?q?Bugfix:=20Don=E2=80=99t=20draw=20borders=20for?= =?utf8?q?=20fullscreen=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/render.h | 2 +- src/con.c | 6 ++++++ src/render.c | 13 +++++++------ src/tree.c | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/render.h b/include/render.h index 849f214e..94084489 100644 --- a/include/render.h +++ b/include/render.h @@ -13,6 +13,6 @@ * updated in X11. * */ -void render_con(Con *con); +void render_con(Con *con, bool render_fullscreen); #endif diff --git a/src/con.c b/src/con.c index fb6866d8..a01bdcc1 100644 --- a/src/con.c +++ b/src/con.c @@ -503,6 +503,12 @@ Rect con_border_style_rect(Con *con) { * */ int con_border_style(Con *con) { + Con *fs = con_get_fullscreen_con(con->parent); + if (fs == con) { + DLOG("this one is fullscreen! overriding BS_NONE\n"); + return BS_NONE; + } + if (con->parent->layout == L_STACKED) return BS_NORMAL; diff --git a/src/render.c b/src/render.c index e3069e72..b1b1bd89 100644 --- a/src/render.c +++ b/src/render.c @@ -16,7 +16,7 @@ static bool show_debug_borders = false; * updated in X11. * */ -void render_con(Con *con) { +void render_con(Con *con, bool render_fullscreen) { printf("currently rendering node %p / %s / layout %d\n", con, con->name, con->layout); int children = con_num_children(con); @@ -49,7 +49,8 @@ void render_con(Con *con) { * needs to be smaller */ Rect *inset = &(con->window_rect); *inset = (Rect){0, 0, con->rect.width, con->rect.height}; - *inset = rect_add(*inset, con_border_style_rect(con)); + if (!render_fullscreen) + *inset = rect_add(*inset, con_border_style_rect(con)); /* Obey x11 border */ inset->width -= (2 * con->border_width); @@ -100,7 +101,7 @@ void render_con(Con *con) { LOG("got fs node: %p\n", fullscreen); fullscreen->rect = rect; x_raise_con(fullscreen); - render_con(fullscreen); + render_con(fullscreen, true); return; } @@ -186,7 +187,7 @@ void render_con(Con *con) { child->rect.x, child->rect.y, child->rect.width, child->rect.height); printf("x now %d, y now %d\n", x, y); x_raise_con(child); - render_con(child); + render_con(child, false); i++; } @@ -198,7 +199,7 @@ void render_con(Con *con) { x_raise_con(foc); /* by rendering the stacked container again, we handle the case * that we have a non-leaf-container inside the stack. */ - render_con(foc); + render_con(foc, false); } } @@ -206,7 +207,7 @@ void render_con(Con *con) { LOG("render floating:\n"); LOG("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); + render_con(child, false); } printf("-- level up\n"); diff --git a/src/tree.c b/src/tree.c index e0b1ab7d..734406b3 100644 --- a/src/tree.c +++ b/src/tree.c @@ -331,7 +331,7 @@ void tree_render() { Con *output; TAILQ_FOREACH(output, &(croot->nodes_head), nodes) { printf("output %p / %s\n", output, output->name); - render_con(output); + render_con(output, false); } x_push_changes(croot); printf("-- END RENDERING --\n"); -- 2.39.5