summaryrefslogtreecommitdiffstats
path: root/src/blueshift_randr_c.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/blueshift_randr_c.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/blueshift_randr_c.c b/src/blueshift_randr_c.c
index 0e38afc..eb3bdf1 100644
--- a/src/blueshift_randr_c.c
+++ b/src/blueshift_randr_c.c
@@ -65,6 +65,7 @@ int blueshift_randr_open(int use_screen, char* display)
xcb_randr_get_crtc_gamma_size_reply_t* gamma_size_reply;
xcb_randr_get_crtc_gamma_cookie_t gamma_get_cookie;
xcb_randr_get_crtc_gamma_reply_t* gamma_get_reply;
+ int iter_i;
@@ -101,7 +102,9 @@ int blueshift_randr_open(int use_screen, char* display)
/* Get X resources */
iter = xcb_setup_roots_iterator(xcb_get_setup(connection));
- screen = iter.data + use_screen;
+ for (iter_i = 0; iter_i < use_screen; iter_i++)
+ xcb_screen_next(&iter);
+ screen = iter.data;
res_cookie = xcb_randr_get_screen_resources_current(connection, screen->root);
res_reply = xcb_randr_get_screen_resources_current_reply(connection, res_cookie, &error);