summaryrefslogtreecommitdiff
path: root/sys/src/libdraw/menuhit.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-06-18 23:23:41 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-06-18 23:23:41 +0200
commitb5659c09770b0bb617a9797e27cc6893a8eb6660 (patch)
tree4783b8846e59dac89a2412ac984d2d1db97cb18b /sys/src/libdraw/menuhit.c
parentd7c7c7e4b37f764174c90939636880f80c8c8c8f (diff)
libdraw: avoid moving cursor if we dont have to for menuhit
depending on the font, poping the menu would move your cursor one pixel down each time (due to division). this is annoying when using a trackpoint and trying to repeat some operation over 9000 times. the cursor should only be moved when the menu is repositioned to contain it on the screen.
Diffstat (limited to 'sys/src/libdraw/menuhit.c')
-rw-r--r--sys/src/libdraw/menuhit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/libdraw/menuhit.c b/sys/src/libdraw/menuhit.c
index cea8bb716..e911466ec 100644
--- a/sys/src/libdraw/menuhit.c
+++ b/sys/src/libdraw/menuhit.c
@@ -234,7 +234,8 @@ menuhit(int but, Mousectl *mc, Menu *menu, Screen *scr)
border(b, menur, Blackborder, bord, ZP);
save = allocimage(display, menurect(textr, 0), screen->chan, 0, -1);
r = menurect(textr, lasti);
- moveto(mc, divpt(addpt(r.min, r.max), 2));
+ if(pt.x || pt.y)
+ moveto(mc, divpt(addpt(r.min, r.max), 2));
menupaint(b, menu, textr, off, nitemdrawn);
if(scrolling)
menuscrollpaint(b, scrollr, off, nitem, nitemdrawn);