From b2397c9f016b299f066c1ebe22eb8f9dc4ff06f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Thu, 5 May 2016 14:18:27 +0200 Subject: [PATCH] Remove redundant depth argument from x_con_init(). (#2323) --- include/x.h | 2 +- src/con.c | 2 +- src/load_layout.c | 2 +- src/x.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/x.h b/include/x.h index b6855cb3..39e0eb2f 100644 --- a/include/x.h +++ b/include/x.h @@ -18,7 +18,7 @@ extern xcb_window_t focused_id; * every container from con_new(). * */ -void x_con_init(Con *con, uint16_t depth); +void x_con_init(Con *con); /** * Moves a child window from Container src to Container dest. diff --git a/src/con.c b/src/con.c index 1ab4a841..2c637a1f 100644 --- a/src/con.c +++ b/src/con.c @@ -68,7 +68,7 @@ Con *con_new_skeleton(Con *parent, i3Window *window) { */ Con *con_new(Con *parent, i3Window *window) { Con *new = con_new_skeleton(parent, window); - x_con_init(new, new->depth); + x_con_init(new); return new; } diff --git a/src/load_layout.c b/src/load_layout.c index 173e573b..863770b7 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -150,7 +150,7 @@ static int json_end_map(void *ctx) { LOG("attaching\n"); con_attach(json_node, json_node->parent, true); LOG("Creating window\n"); - x_con_init(json_node, json_node->depth); + x_con_init(json_node); json_node = json_node->parent; } diff --git a/src/x.c b/src/x.c index 1f812076..ca7d8ae4 100644 --- a/src/x.c +++ b/src/x.c @@ -98,7 +98,7 @@ static con_state *state_for_frame(xcb_window_t window) { * every container from con_new(). * */ -void x_con_init(Con *con, uint16_t depth) { +void x_con_init(Con *con) { /* TODO: maybe create the window when rendering first? we could then even * get the initial geometry right */ @@ -107,7 +107,7 @@ void x_con_init(Con *con, uint16_t depth) { /* For custom visuals, we need to create a colormap before creating * this window. It will be freed directly after creating the window. */ - xcb_visualid_t visual = get_visualid_by_depth(depth); + xcb_visualid_t visual = get_visualid_by_depth(con->depth); xcb_colormap_t win_colormap = xcb_generate_id(conn); xcb_create_colormap_checked(conn, XCB_COLORMAP_ALLOC_NONE, win_colormap, root, visual); @@ -133,7 +133,7 @@ void x_con_init(Con *con, uint16_t depth) { values[4] = win_colormap; Rect dims = {-15, -15, 10, 10}; - xcb_window_t frame_id = create_window(conn, dims, depth, visual, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCURSOR_CURSOR_POINTER, false, mask, values); + xcb_window_t frame_id = create_window(conn, dims, con->depth, visual, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCURSOR_CURSOR_POINTER, false, mask, values); draw_util_surface_init(conn, &(con->frame), frame_id, get_visualtype_by_id(visual), dims.width, dims.height); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, -- 2.39.2