From 92be9fb26cc5691ca30428519205df168e12cf02 Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Fri, 27 Jul 2012 08:02:47 +0800 Subject: [PATCH] Don't query the RandR extension unless it is present. --- spectrwm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); -- 2.39.2