From 312094ace3ad540f9793cf5b114c0cc0db0ee7a2 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 18 Jul 2010 14:32:37 +0200 Subject: [PATCH] Avoid some flickering when a new window opens A new window is by default above all other windows. This means that when we map it and then *later* move it to the correct place in the stacking order (thanks to lazy restacking), the window on the top of the stack has to redraw itself. I noticed this via naughty notifies redrawing themselves after opening a browser window. Signed-off-by: Uli Schlachter --- client.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client.c b/client.c index 38faafe59..d258316f5 100644 --- a/client.c +++ b/client.c @@ -628,6 +628,14 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen, /* Make sure the window is automatically mapped if awesome exits or dies. */ xcb_change_save_set(globalconf.connection, XCB_SET_MODE_INSERT, w); + /* Move this window to the bottom of the stack. Without this we would force + * other windows which will be above this one to redraw themselves because + * this window occludes them for a tiny moment. The next stack_refresh() + * will fix this up and move the window to its correct place. */ + xcb_configure_window(globalconf.connection, w, + XCB_CONFIG_WINDOW_STACK_MODE, + (uint32_t[]) { XCB_STACK_MODE_BELOW}); + client_t *c = client_new(globalconf.L); /* This cannot change, ever. */