From: Michael Stapelberg Date: Thu, 9 Sep 2010 13:34:13 +0000 (+0200) Subject: Bugfix: use the global root variable, don’t get the first one (Thanks quaec) X-Git-Tag: 3.e-bf2~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f2896d34e0da88aa3bd5b942f4cd0c33cdc49aa5;p=i3%2Fi3 Bugfix: use the global root variable, don’t get the first one (Thanks quaec) 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. --- 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 c950df8f..7406bd5e 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);