replace xrandr setup with XCB

This commit is contained in:
David Hill 2012-07-06 16:02:07 -04:00 committed by Reginald Kennedy
parent bef91830c7
commit 7b36e544be

View file

@ -7425,10 +7425,9 @@ void
setup_screens(void) setup_screens(void)
{ {
int i, j, k, num_screens; int i, j, k, num_screens;
int errorbase;
struct workspace *ws; struct workspace *ws;
XGCValues gcv; XGCValues gcv;
const xcb_query_extension_reply_t *qep;
xcb_randr_query_version_cookie_t c; xcb_randr_query_version_cookie_t c;
xcb_randr_query_version_reply_t *r; xcb_randr_query_version_reply_t *r;
@ -7439,18 +7438,16 @@ setup_screens(void)
"screens"); "screens");
/* initial Xrandr setup */ /* initial Xrandr setup */
xrandr_support = XRRQueryExtension(display, xrandr_support = False;
&xrandr_eventbase, &errorbase); c = xcb_randr_query_version(conn, True, True);
if (xrandr_support) { r = xcb_randr_query_version_reply(conn, c, NULL);
c = xcb_randr_query_version(conn, True, False); if (r) {
r = xcb_randr_query_version_reply(conn, c, NULL); if (r->major_version >= 1)
if (r) { xrandr_support = True;
if (r->major_version < 1) free(r);
xrandr_support = 0;
free(r);
} else
xrandr_support = 0;
} }
qep = xcb_get_extension_data(conn, &xcb_randr_id);
xrandr_eventbase = qep->first_event;
/* map physical screens */ /* map physical screens */
for (i = 0; i < num_screens; i++) { for (i = 0; i < num_screens; i++) {