Bugfix: Don’t setup event handler when RandR base event is not set

This commit is contained in:
Michael Stapelberg 2010-10-23 17:18:41 +02:00
parent af9749b1b9
commit 2f6d2d0966
1 changed files with 6 additions and 5 deletions

View File

@ -527,17 +527,18 @@ int main(int argc, char *argv[], char *env[]) {
translate_keysyms(); translate_keysyms();
grab_all_keys(conn, false); grab_all_keys(conn, false);
int randr_base; int randr_base = -1;
if (force_xinerama) { if (force_xinerama) {
initialize_xinerama(conn); initialize_xinerama(conn);
} else { } else {
DLOG("Checking for XRandR...\n"); DLOG("Checking for XRandR...\n");
initialize_randr(conn, &randr_base); initialize_randr(conn, &randr_base);
xcb_event_set_handler(&evenths, if (randr_base != -1)
randr_base + XCB_RANDR_SCREEN_CHANGE_NOTIFY, xcb_event_set_handler(&evenths,
handle_screen_change, randr_base + XCB_RANDR_SCREEN_CHANGE_NOTIFY,
NULL); handle_screen_change,
NULL);
} }
xcb_flush(conn); xcb_flush(conn);