From fec76f9f6c078d10cbcb8e17fc87dcc85e0a2e75 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 23 Dec 2013 12:39:29 +0100 Subject: menu_draw: size window before gap adjustment This saves one redraw over the complete screen height/width, which resulted in a slight flickering, when menu was opened inside a gap. Discovered by Christian Neukirchen, fix proposed by Thomas Adam. --- menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/menu.c b/menu.c index 0a8984c..d9437fb 100644 --- a/menu.c +++ b/menu.c @@ -380,6 +380,10 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq) mc->num++; } + XClearWindow(X_Dpy, sc->menuwin); + XMoveResizeWindow(X_Dpy, sc->menuwin, mc->x, mc->y, + mc->width, mc->height); + xine = screen_find_xinerama(sc, mc->x, mc->y, CWM_GAP); xine.w += xine.x; xine.h += xine.y; @@ -404,10 +408,6 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq) if (mc->x != xsave || mc->y != ysave) xu_ptr_setpos(sc->rootwin, mc->x, mc->y); - XClearWindow(X_Dpy, sc->menuwin); - XMoveResizeWindow(X_Dpy, sc->menuwin, mc->x, mc->y, - mc->width, mc->height); - if (mc->hasprompt) { xu_xft_draw(sc, mc->dispstr, CWM_COLOR_MENU_FONT, 0, sc->xftfont->ascent); -- cgit 1.4.1