diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2012-10-23 15:50:16 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2012-10-23 15:50:16 +0000 |
commit | ccff312def66107b95e801282c492701bb20e02e (patch) | |
tree | 638697cf2d4a02ddafe462fbff30998924139aa1 /app | |
parent | 31479c45513eeafb4654193c0d6d14e3ced84256 (diff) |
treat menu width the same as the height is treated when deciding its
max size and location; partially from a diff from Alexander Polakov.
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/menu.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/cwm/menu.c b/app/cwm/menu.c index 219431a98..fcc5e8939 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.37 2012/10/23 15:32:38 okan Exp $ + * $OpenBSD: menu.c,v 1.38 2012/10/23 15:50:15 okan Exp $ */ #include <sys/param.h> @@ -358,10 +358,12 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq, xsave = mc->x; ysave = mc->y; - if (mc->x < xmin) - mc->x = xmin; - else if (mc->x + mc->width >= xmax) + if (mc->x + mc->width >= xmax) mc->x = xmax - mc->width; + if (mc->x < xmin) { + mc->x = xmin; + mc->width = xmax - xmin; + } if (mc->y + dy >= ymax) mc->y = ymax - dy; |