From ff86f35f0573b230233b83765608b90afd14354e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 9 Sep 2010 15:34:13 +0200 Subject: [PATCH] =?utf8?q?Bugfix:=20use=20the=20global=20root=20variable,?= =?utf8?q?=20don=E2=80=99t=20get=20the=20first=20one=20(Thanks=20quaec)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The case of an X11 server having multiple displays is handled correctly by the code in src/mainx.c. However, due to some functions not being correctly refactored and still getting the first screen (and also the first root window) from the XCB connection, i3 was operating on the wrong root window. --- src/floating.c | 1 - src/handlers.c | 2 -- src/sighandler.c | 1 - src/workspace.c | 1 - src/xcb.c | 1 - 5 files changed, 6 deletions(-) diff --git a/src/floating.c b/src/floating.c index 7e62eea5..93a5b11c 100644 --- a/src/floating.c +++ b/src/floating.c @@ -379,7 +379,6 @@ void floating_resize_window(xcb_connection_t *conn, Client *client, */ void drag_pointer(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event, xcb_window_t confine_to, border_t border, callback_t callback, void *extra) { - xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root; uint32_t new_x, new_y; Rect old_rect; if (client != NULL) diff --git a/src/handlers.c b/src/handlers.c index 12e81f71..31eeced6 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -458,8 +458,6 @@ int handle_screen_change(void *prophs, xcb_connection_t *conn, * */ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) { - xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root; - add_ignore_event(event->sequence); Client *client = table_get(&by_child, event->window); diff --git a/src/sighandler.c b/src/sighandler.c index 92cbc5cb..d789f30b 100644 --- a/src/sighandler.c +++ b/src/sighandler.c @@ -109,7 +109,6 @@ static int sig_handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_p * */ static xcb_window_t open_input_window(xcb_connection_t *conn, Rect screen_rect, uint32_t width, uint32_t height) { - xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root; xcb_window_t win = xcb_generate_id(conn); uint32_t mask = 0; diff --git a/src/workspace.c b/src/workspace.c index 2ae0a498..291f754a 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -112,7 +112,6 @@ bool workspace_is_visible(Workspace *ws) { */ void workspace_show(xcb_connection_t *conn, int workspace) { bool need_warp = false; - xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root; /* t_ws (to workspace) is just a convenience pointer to the workspace we’re switching to */ Workspace *t_ws = workspace_get(workspace-1); diff --git a/src/xcb.c b/src/xcb.c index ee3148ed..38b1d5a8 100644 --- a/src/xcb.c +++ b/src/xcb.c @@ -92,7 +92,6 @@ uint32_t get_colorpixel(xcb_connection_t *conn, char *hex) { */ xcb_window_t create_window(xcb_connection_t *conn, Rect dims, uint16_t window_class, int cursor, bool map, uint32_t mask, uint32_t *values) { - xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root; xcb_window_t result = xcb_generate_id(conn); xcb_cursor_t cursor_id = xcb_generate_id(conn); -- 2.39.5