diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-09-28 01:53:14 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-09-28 01:53:14 +0200 |
commit | 67f3dbdaeeed399029c72174553e9be5f714618a (patch) | |
tree | 8fdd2ce4d2f33105ffaafc3b694b9458953f9a4a | |
parent | 7a91a85509bea4204698270f91c259b451bdd215 (diff) | |
download | plan9front-67f3dbdaeeed399029c72174553e9be5f714618a.tar.xz |
mothra: fix select boxes in textview
-rw-r--r-- | sys/src/cmd/mothra/libpanel/textview.c | 24 |
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; |