From a556f4cfa0db09e45ff24b5bd7d2ef2d2c70c486 Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Thu, 26 Jul 2012 06:58:23 +0800 Subject: [PATCH] Only get xrandr extension data if xrandr is supported. --- spectrwm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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"); -- 1.7.10.4