From ffe297f5e5b4842eb89e1d1840bb5498aabef724 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 23 Jul 2011 22:29:01 +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 --- include/i3.h | 1 + src/main.c | 3 ++- src/randr.c | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/i3.h b/include/i3.h index c54e3c33..22dcd476 100644 --- a/include/i3.h +++ b/include/i3.h @@ -30,6 +30,7 @@ extern TAILQ_HEAD(autostarts_always_head, Autostart) autostarts_always; extern TAILQ_HEAD(ws_assignments_head, Workspace_Assignment) ws_assignments; extern TAILQ_HEAD(assignments_head, Assignment) assignments; extern SLIST_HEAD(stack_wins_head, Stack_Window) stack_wins; +extern xcb_screen_t *root_screen; extern uint8_t root_depth; extern bool xcursor_supported, xkb_supported; extern xcb_window_t root; diff --git a/src/main.c b/src/main.c index 3ef394a2..b88a2082 100644 --- a/src/main.c +++ b/src/main.c @@ -16,6 +16,7 @@ char **start_argv; xcb_connection_t *conn; +xcb_screen_t *root_screen; xcb_window_t root; uint8_t root_depth; @@ -270,7 +271,7 @@ int main(int argc, char *argv[]) { if (main_loop == NULL) die("Could not initialize libev. Bad LIBEV_FLAGS?\n"); - xcb_screen_t *root_screen = xcb_aux_get_screen(conn, screens); + root_screen = xcb_aux_get_screen(conn, screens); root = root_screen->root; root_depth = root_screen->root_depth; xcb_get_geometry_cookie_t gcookie = xcb_get_geometry(conn, root); diff --git a/src/randr.c b/src/randr.c index f13cab67..bdd55365 100644 --- a/src/randr.c +++ b/src/randr.c @@ -149,8 +149,6 @@ Output *get_output_most(direction_t direction, Output *current) { * */ void disable_randr(xcb_connection_t *conn) { - xcb_screen_t *root_screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data; - DLOG("RandR extension unusable, disabling.\n"); Output *s = scalloc(sizeof(Output)); -- 2.39.5