summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-09-28 01:53:14 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-09-28 01:53:14 +0200
commit67f3dbdaeeed399029c72174553e9be5f714618a (patch)
tree8fdd2ce4d2f33105ffaafc3b694b9458953f9a4a
parent7a91a85509bea4204698270f91c259b451bdd215 (diff)
downloadplan9front-67f3dbdaeeed399029c72174553e9be5f714618a.tar.xz
mothra: fix select boxes in textview
-rw-r--r--sys/src/cmd/mothra/libpanel/textview.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/src/cmd/mothra/libpanel/textview.c b/sys/src/cmd/mothra/libpanel/textview.c
index d50d1a330..be5be06c5 100644
--- a/sys/src/cmd/mothra/libpanel/textview.c
+++ b/sys/src/cmd/mothra/libpanel/textview.c
@@ -74,17 +74,19 @@ int pl_hittextview(Panel *p, Mouse *m){
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;