]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t setup event handler when RandR base event is not set
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 23 Oct 2010 15:18:41 +0000 (17:18 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 23 Oct 2010 15:18:41 +0000 (17:18 +0200)
src/mainx.c

index d459559c847e14edb50b75e7fa5641a6e47edb4d..b0ae40b98ca47f2bc868ce62a5a621ee5b6dd1d6 100644 (file)
@@ -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);