From: Michael Stapelberg Date: Tue, 3 Oct 2017 08:00:55 +0000 (+0200) Subject: skip ConfigureNotify events with --force_xinerama X-Git-Tag: 4.15~48^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8e528d2de8d75eb1b053ccac5b1f119292eb68dc;p=i3%2Fi3 skip ConfigureNotify events with --force_xinerama This prevents an i3 crash under certain conditions when running the tests. --- diff --git a/include/i3.h b/include/i3.h index 4d13d448..93a7e0a3 100644 --- a/include/i3.h +++ b/include/i3.h @@ -74,3 +74,4 @@ extern bool xcursor_supported, xkb_supported; extern xcb_window_t root; extern struct ev_loop *main_loop; extern bool only_check_config; +extern bool force_xinerama; diff --git a/src/handlers.c b/src/handlers.c index 436fb2ab..0f81afae 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -1264,6 +1264,9 @@ static void handle_configure_notify(xcb_configure_notify_event_t *event) { } DLOG("ConfigureNotify for root window 0x%08x\n", event->event); + if (force_xinerama) { + return; + } randr_query_outputs(); } diff --git a/src/main.c b/src/main.c index 0d1457fd..3087f111 100644 --- a/src/main.c +++ b/src/main.c @@ -92,6 +92,8 @@ struct ws_assignments_head ws_assignments = TAILQ_HEAD_INITIALIZER(ws_assignment bool xcursor_supported = true; bool xkb_supported = true; +bool force_xinerama = false; + /* * This callback is only a dummy, see xcb_prepare_cb and xcb_check_cb. * See also man libev(3): "ev_prepare" and "ev_check" - customise your event loop @@ -197,7 +199,6 @@ int main(int argc, char *argv[]) { bool autostart = true; char *layout_path = NULL; bool delete_layout_path = false; - bool force_xinerama = false; bool disable_randr15 = false; char *fake_outputs = NULL; bool disable_signalhandler = false; @@ -550,6 +551,10 @@ int main(int argc, char *argv[]) { config.ipc_socket_path = sstrdup(config.ipc_socket_path); } + if (config.force_xinerama) { + force_xinerama = true; + } + xcb_void_cookie_t cookie; cookie = xcb_change_window_attributes_checked(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK}); xcb_generic_error_t *error = xcb_request_check(conn, cookie); @@ -668,7 +673,7 @@ int main(int argc, char *argv[]) { fake_outputs_init(fake_outputs); FREE(fake_outputs); config.fake_outputs = NULL; - } else if (force_xinerama || config.force_xinerama) { + } else if (force_xinerama) { /* Force Xinerama (for drivers which don't support RandR yet, esp. the * nVidia binary graphics driver), when specified either in the config * file or on command-line */