summary refs log tree commit diff
path: root/menu.c
diff options
context:
space:
mode:
authorokan <okan>2014-01-02 22:49:10 +0000
committerokan <okan>2014-01-02 22:49:10 +0000
commit2843ba1e2812f8424e0649946d77bd92a3ad49d8 (patch)
tree7f8c1310cafaa1702615d82b267fcdf2ab84066c /menu.c
parent376e98c2c8db3e298d503ef5ccf2c78937adad9b (diff)
downloadcwm-2843ba1e2812f8424e0649946d77bd92a3ad49d8.tar.gz
cwm-2843ba1e2812f8424e0649946d77bd92a3ad49d8.tar.xz
cwm-2843ba1e2812f8424e0649946d77bd92a3ad49d8.zip
calculate proper menu width/height on the first Expose event; 'jump' (while using gap) noticed by Christian Neukirchen
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/menu.c b/menu.c
index b0875ee..c20f012 100644
--- a/menu.c
+++ b/menu.c
@@ -392,13 +392,13 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq)
 		mc->x = xine.w - mc->width;
 	if (mc->x < xine.x) {
 		mc->x = xine.x;
-		mc->width = xine.w - xine.x;
+		mc->width = MIN(mc->width, (xine.w - xine.x));
 	}
 	if (mc->y + mc->height >= xine.h)
 		mc->y = xine.h - mc->height;
 	if (mc->y < xine.y) {
 		mc->y = xine.y;
-		mc->height = xine.h - xine.y;
+		mc->height = MIN(mc->height, (xine.h - xine.y));
 	}
 
 	if (mc->x != xsave || mc->y != ysave)