]> 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:19:46 +0000 (17:19 +0200)
src/mainx.c

index 17f2bec83b190df24e25f6200872a737afc6886d..4126fe58be0dac3b0dcb17fd0426a2c35ba279a4 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);