From: martin Date: Wed, 25 May 2016 20:19:17 +0000 (+0200) Subject: Flush xcb connection after opening fullscreen window (#74) X-Git-Tag: 2.8~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=402254b5752fcf6a8197b92f558cb0c35289fa74;p=i3%2Fi3lock Flush xcb connection after opening fullscreen window (#74) We need to ensure that the window handle is valid, i. e. the window is actually created and accessible, before returning. This is necessary because we immediately fork after returning, and the child process opens its own X11 connection and expects the window handle to be valid. Fixes #46 --- diff --git a/xcb.c b/xcb.c index f1a9a76..3e8cd07 100644 --- a/xcb.c +++ b/xcb.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -150,6 +151,9 @@ xcb_window_t open_fullscreen_window(xcb_connection_t *conn, xcb_screen_t *scr, c values[0] = XCB_STACK_MODE_ABOVE; xcb_configure_window(conn, win, XCB_CONFIG_WINDOW_STACK_MODE, values); + /* Ensure that the window is created and set up before returning */ + xcb_aux_sync(conn); + return win; }