mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
fix off-by-one where a mere click would select the first item inside a menu
from Thomas Pfaff ok oga@
This commit is contained in:
parent
ab4d36531c
commit
46630531f8
2
menu.c
2
menu.c
@ -398,7 +398,7 @@ menu_calc_entry(struct screen_ctx *sc, struct menu_ctx *mc, int x, int y)
|
|||||||
entry = y / font_height();
|
entry = y / font_height();
|
||||||
|
|
||||||
/* in bounds? */
|
/* in bounds? */
|
||||||
if (x < 0 || x > mc->width || y < 0 || y > font_height() * mc->num ||
|
if (x <= 0 || x > mc->width || y <= 0 || y > font_height() * mc->num ||
|
||||||
entry < 0 || entry >= mc->num)
|
entry < 0 || entry >= mc->num)
|
||||||
entry = -1;
|
entry = -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user