diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2014-01-02 22:49:11 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2014-01-02 22:49:11 +0000 |
commit | cb1489d6968662b424f0c9dbfbd8dbe9a55a6b2f (patch) | |
tree | c8eb4940f884d10eca4345e129f767a8186db79f | |
parent | 5044da79807d8c5ec994ea89165d46b155a46198 (diff) |
calculate proper menu width/height on the first Expose event; 'jump' (while using gap) noticed by Christian Neukirchen
-rw-r--r-- | app/cwm/menu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/cwm/menu.c b/app/cwm/menu.c index 015072907..b13872acb 100644 --- a/app/cwm/menu.c +++ b/app/cwm/menu.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.70 2013/12/17 16:10:43 okan Exp $ + * $OpenBSD: menu.c,v 1.71 2014/01/02 22:49:10 okan Exp $ */ #include <sys/param.h> @@ -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) |