git: 9front

Download patch

ref: e676d787ae08f0588e54e3aa270cde90a9dc6a88
parent: b6595325c928f837668dbe8ece1e6d1cabe38445
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Thu Sep 27 21:53:14 EDT 2012

mothra: fix select boxes in textview

--- a/sys/src/cmd/mothra/libpanel/textview.c
+++ b/sys/src/cmd/mothra/libpanel/textview.c
@@ -74,17 +74,19 @@
 	else if(m->buttons&7){
 		p->state=DOWN;
 		tp->buttons=m->buttons;
-		ul=p->r.min;
-		size=subpt(p->r.max, p->r.min);
-		pl_interior(p->state, &ul, &size);
-		tp->hitword=pl_rthit(tp->text, tp->yoffs, m->xy, ul);
-		if(tp->hitword==0)
-			if(oldhitword!=0 && oldstate==DOWN)
-				tp->hitword=oldhitword;
-			else
-				tp->hitfirst=0;
-		if(tp->hitword!=0 && oldstate!=DOWN)
-			tp->hitfirst=tp->hitword;
+		if(oldhitword==0 || oldhitword->p==0 || (oldhitword->p->flags&REMOUSE)==0){
+			ul=p->r.min;
+			size=subpt(p->r.max, p->r.min);
+			pl_interior(p->state, &ul, &size);
+			tp->hitword=pl_rthit(tp->text, tp->yoffs, m->xy, ul);
+			if(tp->hitword==0)
+				if(oldhitword!=0 && oldstate==DOWN)
+					tp->hitword=oldhitword;
+				else
+					tp->hitfirst=0;
+			if(tp->hitword!=0 && oldstate!=DOWN)
+				tp->hitfirst=tp->hitword;
+		}
 	}
 	else{
 		if(p->state==DOWN) hitme=1;
--