From: Reginald Kennedy Date: Wed, 25 Jul 2012 22:58:23 +0000 (+0800) Subject: Only get xrandr extension data if xrandr is supported. X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=a556f4cfa0db09e45ff24b5bd7d2ef2d2c70c486;p=spectrwm.git Only get xrandr extension data if xrandr is supported. --- diff --git a/spectrwm.c b/spectrwm.c index 0be0227..ace7c52 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -7695,12 +7695,15 @@ setup_screens(void) 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; + if (r->major_version >= 1) { + qep = xcb_get_extension_data(conn, &xcb_randr_id); + if (qep) { + xrandr_support = 1; + xrandr_eventbase = qep->first_event; + } + } free(r); } - qep = xcb_get_extension_data(conn, &xcb_randr_id); - xrandr_eventbase = qep->first_event; cursor_font = xcb_generate_id(conn); xcb_open_font(conn, cursor_font, strlen("cursor"), "cursor");