Bugfix: Don’t draw borders for fullscreen windows

This commit is contained in:
Michael Stapelberg 2010-11-21 17:00:10 +01:00
parent 09b5b17830
commit 2d280469af
4 changed files with 15 additions and 8 deletions

View File

@ -13,6 +13,6 @@
* updated in X11. * updated in X11.
* *
*/ */
void render_con(Con *con); void render_con(Con *con, bool render_fullscreen);
#endif #endif

View File

@ -503,6 +503,12 @@ Rect con_border_style_rect(Con *con) {
* *
*/ */
int con_border_style(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) if (con->parent->layout == L_STACKED)
return BS_NORMAL; return BS_NORMAL;

View File

@ -16,7 +16,7 @@ static bool show_debug_borders = false;
* updated in X11. * 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", printf("currently rendering node %p / %s / layout %d\n",
con, con->name, con->layout); con, con->name, con->layout);
int children = con_num_children(con); int children = con_num_children(con);
@ -49,6 +49,7 @@ void render_con(Con *con) {
* needs to be smaller */ * needs to be smaller */
Rect *inset = &(con->window_rect); 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)); *inset = rect_add(*inset, con_border_style_rect(con));
/* Obey x11 border */ /* Obey x11 border */
@ -100,7 +101,7 @@ void render_con(Con *con) {
LOG("got fs node: %p\n", fullscreen); LOG("got fs node: %p\n", fullscreen);
fullscreen->rect = rect; fullscreen->rect = rect;
x_raise_con(fullscreen); x_raise_con(fullscreen);
render_con(fullscreen); render_con(fullscreen, true);
return; return;
} }
@ -186,7 +187,7 @@ void render_con(Con *con) {
child->rect.x, child->rect.y, child->rect.width, child->rect.height); child->rect.x, child->rect.y, child->rect.width, child->rect.height);
printf("x now %d, y now %d\n", x, y); printf("x now %d, y now %d\n", x, y);
x_raise_con(child); x_raise_con(child);
render_con(child); render_con(child, false);
i++; i++;
} }
@ -198,7 +199,7 @@ void render_con(Con *con) {
x_raise_con(foc); x_raise_con(foc);
/* by rendering the stacked container again, we handle the case /* by rendering the stacked container again, we handle the case
* that we have a non-leaf-container inside the stack. */ * 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("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); 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); x_raise_con(child);
render_con(child); render_con(child, false);
} }
printf("-- level up\n"); printf("-- level up\n");

View File

@ -331,7 +331,7 @@ void tree_render() {
Con *output; Con *output;
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) { TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
printf("output %p / %s\n", output, output->name); printf("output %p / %s\n", output, output->name);
render_con(output); render_con(output, false);
} }
x_push_changes(croot); x_push_changes(croot);
printf("-- END RENDERING --\n"); printf("-- END RENDERING --\n");