libdraw: don't redraw input box in enter/eenter when mouse is moved outside the rectangle

prevents some flickering when devdraw is used over a high latency connection.

Fixes issue 236
This commit is contained in:
mischief 2015-01-09 15:41:00 -08:00
parent 79ff9d28bd
commit f6a9db1bd9
2 changed files with 4 additions and 2 deletions

View file

@ -111,6 +111,7 @@ eenter(char *ask, char *buf, int len, Mouse *m)
sc = b->clipr;
replclipr(b, 0, b->r);
nodraw:
switch(i){
default:
done = 1;
@ -187,7 +188,7 @@ eenter(char *ask, char *buf, int len, Mouse *m)
*m = ev.mouse;
if(!ptinrect(m->xy, r)){
down = 0;
continue;
goto nodraw;
}
if(m->buttons & 7){
down = 1;

View file

@ -120,6 +120,7 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
}
flushimage(display, 1);
nodraw:
switch(alt(a)){
case -1:
done = 1;
@ -194,7 +195,7 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
case 1:
if(!ptinrect(m.xy, r)){
down = 0;
continue;
goto nodraw;
}
if(m.buttons & 7){
down = 1;