]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: use the global root variable, don’t get the first one (Thanks quaec)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 23 Jul 2011 20:29:01 +0000 (22:29 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 23 Jul 2011 20:29:01 +0000 (22:29 +0200)
include/i3.h
src/main.c
src/randr.c

index c54e3c3328478b680fc1278a3c9db9783fdaab73..22dcd476b9605349f2ef53fbd02039a3659498b1 100644 (file)
@@ -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;
index 3ef394a27e3ce120cc76358235457d0ee404bc85..b88a2082492eb0df7a2ada60bcc38adcfa978562 100644 (file)
@@ -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);
index f13cab67ecbac45213c1639491550f49096702dd..bdd553656a8a921f832e10cfbe6460a628f2abf0 100644 (file)
@@ -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));