changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: libdraw: don't redraw input box in enter/eenter when mouse is moved outside the rectangle

changeset 4188: f0be8cddca55
parent 4187: 8fb78de1301d
child 4190: fbe5f205ecc4
author: mischief <mischief@offblast.org>
date: Fri, 09 Jan 2015 15:41:00 -0800
files: sys/src/libdraw/eenter.c sys/src/libdraw/enter.c
description: 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
     1.1--- a/sys/src/libdraw/eenter.c
     1.2+++ b/sys/src/libdraw/eenter.c
     1.3@@ -111,6 +111,7 @@ eenter(char *ask, char *buf, int len, Mo
     1.4 		sc = b->clipr;
     1.5 		replclipr(b, 0, b->r);
     1.6 
     1.7+nodraw:
     1.8 		switch(i){
     1.9 		default:
    1.10 			done = 1;
    1.11@@ -187,7 +188,7 @@ eenter(char *ask, char *buf, int len, Mo
    1.12 			*m = ev.mouse;
    1.13 			if(!ptinrect(m->xy, r)){
    1.14 				down = 0;
    1.15-				continue;
    1.16+				goto nodraw;
    1.17 			}
    1.18 			if(m->buttons & 7){
    1.19 				down = 1;
     2.1--- a/sys/src/libdraw/enter.c
     2.2+++ b/sys/src/libdraw/enter.c
     2.3@@ -120,6 +120,7 @@ enter(char *ask, char *buf, int len, Mou
     2.4 		}
     2.5 		flushimage(display, 1);
     2.6 
     2.7+nodraw:
     2.8 		switch(alt(a)){
     2.9 		case -1:
    2.10 			done = 1;
    2.11@@ -194,7 +195,7 @@ enter(char *ask, char *buf, int len, Mou
    2.12 		case 1:
    2.13 			if(!ptinrect(m.xy, r)){
    2.14 				down = 0;
    2.15-				continue;
    2.16+				goto nodraw;
    2.17 			}
    2.18 			if(m.buttons & 7){
    2.19 				down = 1;