about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2013-12-23 12:39:29 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2013-12-23 12:39:29 +0100
commitfec76f9f6c078d10cbcb8e17fc87dcc85e0a2e75 (patch)
treefc08000fae6baf63de154868b72ee5623d396421
parentb387351df1593020665df5e5ee5d86d16ad8b7d6 (diff)
downloadcwm-fec76f9f6c078d10cbcb8e17fc87dcc85e0a2e75.tar.gz
cwm-fec76f9f6c078d10cbcb8e17fc87dcc85e0a2e75.tar.xz
cwm-fec76f9f6c078d10cbcb8e17fc87dcc85e0a2e75.zip
menu_draw: size window before gap adjustment cn-menu-redraw
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.
-rw-r--r--menu.c8
1 files 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);