From: Reginald Kennedy Date: Fri, 27 Jul 2012 00:02:47 +0000 (+0800) Subject: Don't query the RandR extension unless it is present. X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=92be9fb26cc5691ca30428519205df168e12cf02;p=spectrwm.git Don't query the RandR extension unless it is present. --- diff --git a/spectrwm.c b/spectrwm.c index f4ab936..0379156 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -7739,17 +7739,17 @@ setup_screens(void) /* initial Xrandr setup */ xrandr_support = 0; - c = xcb_randr_query_version(conn, 1, 1); - r = xcb_randr_query_version_reply(conn, c, NULL); - if (r) { - if (r->major_version >= 1) { - qep = xcb_get_extension_data(conn, &xcb_randr_id); - if (qep) { + qep = xcb_get_extension_data(conn, &xcb_randr_id); + if (qep->present) { + c = xcb_randr_query_version(conn, 1, 1); + r = xcb_randr_query_version_reply(conn, c, NULL); + if (r) { + if (r->major_version >= 1) { xrandr_support = 1; xrandr_eventbase = qep->first_event; } + free(r); } - free(r); } cursor_font = xcb_generate_id(conn);