From: Michael Stapelberg Date: Sat, 23 Oct 2010 15:18:41 +0000 (+0200) Subject: Bugfix: Don’t setup event handler when RandR base event is not set X-Git-Tag: 3.e-bf2~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3bb963cf3197e9b8ed2e3afcae94b33e385ddbec;p=i3%2Fi3 Bugfix: Don’t setup event handler when RandR base event is not set --- diff --git a/src/mainx.c b/src/mainx.c index d459559c..b0ae40b9 100644 --- a/src/mainx.c +++ b/src/mainx.c @@ -527,17 +527,18 @@ int main(int argc, char *argv[], char *env[]) { translate_keysyms(); grab_all_keys(conn, false); - int randr_base; + int randr_base = -1; if (force_xinerama) { initialize_xinerama(conn); } else { DLOG("Checking for XRandR...\n"); initialize_randr(conn, &randr_base); - xcb_event_set_handler(&evenths, - randr_base + XCB_RANDR_SCREEN_CHANGE_NOTIFY, - handle_screen_change, - NULL); + if (randr_base != -1) + xcb_event_set_handler(&evenths, + randr_base + XCB_RANDR_SCREEN_CHANGE_NOTIFY, + handle_screen_change, + NULL); } xcb_flush(conn);