summaryrefslogtreecommitdiffstats
path: root/src/blueshift_randr_c.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-02 23:00:40 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-02 23:00:40 +0200
commit535ad95cbb469a0c7047881bbffe2460d21917d8 (patch)
tree200c98c14edd3ca2f3f8adeaf608da2513291939 /src/blueshift_randr_c.c
parentm doc (diff)
downloadblueshift-535ad95cbb469a0c7047881bbffe2460d21917d8.tar.gz
blueshift-535ad95cbb469a0c7047881bbffe2460d21917d8.tar.bz2
blueshift-535ad95cbb469a0c7047881bbffe2460d21917d8.tar.xz
probably a multi-screen bug fix
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/blueshift_randr_c.c')
-rw-r--r--src/blueshift_randr_c.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/blueshift_randr_c.c b/src/blueshift_randr_c.c
index fe3c708..6a15715 100644
--- a/src/blueshift_randr_c.c
+++ b/src/blueshift_randr_c.c
@@ -56,7 +56,6 @@ int blueshift_randr_open(int use_screen)
xcb_randr_query_version_cookie_t version_cookie;
xcb_randr_query_version_reply_t* randr_version;
- const xcb_setup_t* setup;
xcb_screen_iterator_t iter;
xcb_screen_t* screen;
xcb_randr_get_screen_resources_current_cookie_t res_cookie;
@@ -70,7 +69,7 @@ int blueshift_randr_open(int use_screen)
/* Get X connection */
- connection = xcb_connect(NULL, &use_screen);
+ connection = xcb_connect(NULL, NULL);
/* Check RandR protocol version */
@@ -100,9 +99,8 @@ int blueshift_randr_open(int use_screen)
/* Get X resources */
- setup = xcb_get_setup(connection);
- iter = xcb_setup_roots_iterator(setup);
- screen = iter.data;
+ iter = xcb_setup_roots_iterator(xcb_get_setup(connection));
+ screen = iter.data + use_screen;
res_cookie = xcb_randr_get_screen_resources_current(connection, screen->root);
res_reply = xcb_randr_get_screen_resources_current_reply(connection, res_cookie, &error);