From: Orestis Floros Date: Mon, 1 Oct 2018 23:13:51 +0000 (+0300) Subject: render_con: Get rid of render_fullscreen argument X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=100d05a2a662c339da616c6bdc3a1f7e3d95d355;p=i3%2Fi3 render_con: Get rid of render_fullscreen argument Only true for the fullscreen container and doesn't affect any of its children. Thus, we can get the same result by checking ->fullscreen_mode. --- diff --git a/include/render.h b/include/render.h index 2b2c8dad..03751c01 100644 --- a/include/render.h +++ b/include/render.h @@ -40,7 +40,7 @@ typedef struct render_params { * updated in X11. * */ -void render_con(Con *con, bool render_fullscreen); +void render_con(Con *con); /** * Returns the height for the decorations diff --git a/src/commands.c b/src/commands.c index ee402846..ed5e482d 100644 --- a/src/commands.c +++ b/src/commands.c @@ -831,7 +831,7 @@ void cmd_append_layout(I3_CMD, const char *cpath) { // is not executed yet and will be batched with append_layout’s // needs_tree_render after the parser finished. We should check if that is // necessary at all. - render_con(croot, false); + render_con(croot); restore_open_placeholder_windows(parent); diff --git a/src/floating.c b/src/floating.c index 4f2760a7..c8b436b4 100644 --- a/src/floating.c +++ b/src/floating.c @@ -412,8 +412,7 @@ void floating_enable(Con *con, bool automatic) { DLOG("Corrected y = %d (deco_height = %d)\n", nc->rect.y, deco_height); /* render the cons to get initial window_rect correct */ - render_con(nc, false); - render_con(con, false); + render_con(nc); if (set_focus) con_activate(con); @@ -568,7 +567,7 @@ DRAGGING_CB(drag_window_callback) { con->rect.x = old_rect->x + (new_x - event->root_x); con->rect.y = old_rect->y + (new_y - event->root_y); - render_con(con, false); + render_con(con); x_push_node(con); xcb_flush(conn); diff --git a/src/manage.c b/src/manage.c index c222d351..63cadc0c 100644 --- a/src/manage.c +++ b/src/manage.c @@ -569,13 +569,13 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki * workspace at all. However, just calling render_con() on the * workspace isn’t enough either — it needs the rect. */ ws->rect = ws->parent->rect; - render_con(ws, true); + render_con(ws); /* Disable setting focus, otherwise we’d move focus to an invisible * workspace, which we generally prevent (e.g. in * con_move_to_workspace). */ set_focus = false; } - render_con(croot, false); + render_con(croot); /* Send an event about window creation */ ipc_send_window_event("new", nc); diff --git a/src/render.c b/src/render.c index 518d436b..e9e38ae0 100644 --- a/src/render.c +++ b/src/render.c @@ -37,16 +37,15 @@ int render_deco_height(void) { * updated in X11. * */ -void render_con(Con *con, bool render_fullscreen) { +void render_con(Con *con) { render_params params = { .rect = con->rect, .x = con->rect.x, .y = con->rect.y, .children = con_num_children(con)}; - DLOG("Rendering %snode %p / %s / layout %d / children %d\n", - (render_fullscreen ? "fullscreen " : ""), con, con->name, con->layout, - params.children); + DLOG("Rendering node %p / %s / layout %d / children %d\n", con, con->name, + con->layout, params.children); int i = 0; con->mapped = true; @@ -57,8 +56,9 @@ void render_con(Con *con, bool render_fullscreen) { * needs to be smaller */ Rect *inset = &(con->window_rect); *inset = (Rect){0, 0, con->rect.width, con->rect.height}; - if (!render_fullscreen) + if (con->fullscreen_mode == CF_NONE) { *inset = rect_add(*inset, con_border_style_rect(con)); + } /* Obey x11 border */ inset->width -= (2 * con->border_width); @@ -81,7 +81,7 @@ void render_con(Con *con, bool render_fullscreen) { if (fullscreen) { fullscreen->rect = params.rect; x_raise_con(fullscreen); - render_con(fullscreen, true); + render_con(fullscreen); /* 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, @@ -124,7 +124,7 @@ void render_con(Con *con, bool render_fullscreen) { DLOG("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); + render_con(child); i++; } @@ -137,7 +137,7 @@ void render_con(Con *con, bool render_fullscreen) { * that we have a non-leaf-container inside the stack. In that * case, the children of the non-leaf-container need to be raised * as well. */ - render_con(child, false); + render_con(child); } if (params.children != 1) @@ -186,7 +186,7 @@ static void render_root(Con *con, Con *fullscreen) { Con *output; if (!fullscreen) { TAILQ_FOREACH(output, &(con->nodes_head), nodes) { - render_con(output, false); + render_con(output); } } @@ -252,7 +252,7 @@ static void render_root(Con *con, Con *fullscreen) { 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); + render_con(child); } } } @@ -302,7 +302,7 @@ static void render_output(Con *con) { if (fullscreen) { fullscreen->rect = con->rect; x_raise_con(fullscreen); - render_con(fullscreen, true); + render_con(fullscreen); return; } @@ -342,7 +342,7 @@ static void render_output(Con *con) { DLOG("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); + render_con(child); } } diff --git a/src/tree.c b/src/tree.c index e3849873..99b03619 100644 --- a/src/tree.c +++ b/src/tree.c @@ -453,7 +453,7 @@ void tree_render(void) { mark_unmapped(croot); croot->mapped = true; - render_con(croot, false); + render_con(croot); x_push_changes(croot); DLOG("-- END RENDERING --\n");