From 2f6d2d09667497918040877b868459076d6291a0 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 23 Oct 2010 17:18:41 +0200 Subject: [PATCH] =?UTF-8?q?Bugfix:=20Don=E2=80=99t=20setup=20event=20handl?= =?UTF-8?q?er=20when=20RandR=20base=20event=20is=20not=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mainx.c b/src/mainx.c index 17f2bec8..4126fe58 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);