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.
This commit is contained in:
Orestis Floros 2018-10-02 02:13:51 +03:00
parent 29f2510fa9
commit 100d05a2a6
No known key found for this signature in database
GPG Key ID: E9AD9F32E401E38F
6 changed files with 19 additions and 20 deletions

View File

@ -40,7 +40,7 @@ typedef struct render_params {
* updated in X11. * updated in X11.
* *
*/ */
void render_con(Con *con, bool render_fullscreen); void render_con(Con *con);
/** /**
* Returns the height for the decorations * Returns the height for the decorations

View File

@ -831,7 +831,7 @@ void cmd_append_layout(I3_CMD, const char *cpath) {
// is not executed yet and will be batched with append_layouts // is not executed yet and will be batched with append_layouts
// needs_tree_render after the parser finished. We should check if that is // needs_tree_render after the parser finished. We should check if that is
// necessary at all. // necessary at all.
render_con(croot, false); render_con(croot);
restore_open_placeholder_windows(parent); restore_open_placeholder_windows(parent);

View File

@ -412,8 +412,7 @@ void floating_enable(Con *con, bool automatic) {
DLOG("Corrected y = %d (deco_height = %d)\n", nc->rect.y, deco_height); DLOG("Corrected y = %d (deco_height = %d)\n", nc->rect.y, deco_height);
/* render the cons to get initial window_rect correct */ /* render the cons to get initial window_rect correct */
render_con(nc, false); render_con(nc);
render_con(con, false);
if (set_focus) if (set_focus)
con_activate(con); 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.x = old_rect->x + (new_x - event->root_x);
con->rect.y = old_rect->y + (new_y - event->root_y); con->rect.y = old_rect->y + (new_y - event->root_y);
render_con(con, false); render_con(con);
x_push_node(con); x_push_node(con);
xcb_flush(conn); xcb_flush(conn);

View File

@ -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 at all. However, just calling render_con() on the
* workspace isnt enough either it needs the rect. */ * workspace isnt enough either it needs the rect. */
ws->rect = ws->parent->rect; ws->rect = ws->parent->rect;
render_con(ws, true); render_con(ws);
/* Disable setting focus, otherwise wed move focus to an invisible /* Disable setting focus, otherwise wed move focus to an invisible
* workspace, which we generally prevent (e.g. in * workspace, which we generally prevent (e.g. in
* con_move_to_workspace). */ * con_move_to_workspace). */
set_focus = false; set_focus = false;
} }
render_con(croot, false); render_con(croot);
/* Send an event about window creation */ /* Send an event about window creation */
ipc_send_window_event("new", nc); ipc_send_window_event("new", nc);

View File

@ -37,16 +37,15 @@ int render_deco_height(void) {
* updated in X11. * updated in X11.
* *
*/ */
void render_con(Con *con, bool render_fullscreen) { void render_con(Con *con) {
render_params params = { render_params params = {
.rect = con->rect, .rect = con->rect,
.x = con->rect.x, .x = con->rect.x,
.y = con->rect.y, .y = con->rect.y,
.children = con_num_children(con)}; .children = con_num_children(con)};
DLOG("Rendering %snode %p / %s / layout %d / children %d\n", DLOG("Rendering node %p / %s / layout %d / children %d\n", con, con->name,
(render_fullscreen ? "fullscreen " : ""), con, con->name, con->layout, con->layout, params.children);
params.children);
int i = 0; int i = 0;
con->mapped = true; con->mapped = true;
@ -57,8 +56,9 @@ void render_con(Con *con, bool render_fullscreen) {
* 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) if (con->fullscreen_mode == CF_NONE) {
*inset = rect_add(*inset, con_border_style_rect(con)); *inset = rect_add(*inset, con_border_style_rect(con));
}
/* Obey x11 border */ /* Obey x11 border */
inset->width -= (2 * con->border_width); inset->width -= (2 * con->border_width);
@ -81,7 +81,7 @@ void render_con(Con *con, bool render_fullscreen) {
if (fullscreen) { if (fullscreen) {
fullscreen->rect = params.rect; fullscreen->rect = params.rect;
x_raise_con(fullscreen); x_raise_con(fullscreen);
render_con(fullscreen, true); render_con(fullscreen);
/* Fullscreen containers are either global (underneath the CT_ROOT /* Fullscreen containers are either global (underneath the CT_ROOT
* container) or per-output (underneath the CT_CONTENT container). For * container) or per-output (underneath the CT_CONTENT container). For
* global fullscreen containers, we cannot abort rendering here yet, * 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", DLOG("child at (%d, %d) with (%d x %d)\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height); child->rect.x, child->rect.y, child->rect.width, child->rect.height);
x_raise_con(child); x_raise_con(child);
render_con(child, false); render_con(child);
i++; 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 * that we have a non-leaf-container inside the stack. In that
* case, the children of the non-leaf-container need to be raised * case, the children of the non-leaf-container need to be raised
* as well. */ * as well. */
render_con(child, false); render_con(child);
} }
if (params.children != 1) if (params.children != 1)
@ -186,7 +186,7 @@ static void render_root(Con *con, Con *fullscreen) {
Con *output; Con *output;
if (!fullscreen) { if (!fullscreen) {
TAILQ_FOREACH(output, &(con->nodes_head), nodes) { 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", DLOG("floating child at (%d,%d) with %d x %d\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height); child->rect.x, child->rect.y, child->rect.width, child->rect.height);
x_raise_con(child); x_raise_con(child);
render_con(child, false); render_con(child);
} }
} }
} }
@ -302,7 +302,7 @@ static void render_output(Con *con) {
if (fullscreen) { if (fullscreen) {
fullscreen->rect = con->rect; fullscreen->rect = con->rect;
x_raise_con(fullscreen); x_raise_con(fullscreen);
render_con(fullscreen, true); render_con(fullscreen);
return; return;
} }
@ -342,7 +342,7 @@ static void render_output(Con *con) {
DLOG("child at (%d, %d) with (%d x %d)\n", DLOG("child at (%d, %d) with (%d x %d)\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height); child->rect.x, child->rect.y, child->rect.width, child->rect.height);
x_raise_con(child); x_raise_con(child);
render_con(child, false); render_con(child);
} }
} }

View File

@ -453,7 +453,7 @@ void tree_render(void) {
mark_unmapped(croot); mark_unmapped(croot);
croot->mapped = true; croot->mapped = true;
render_con(croot, false); render_con(croot);
x_push_changes(croot); x_push_changes(croot);
DLOG("-- END RENDERING --\n"); DLOG("-- END RENDERING --\n");