diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-01 13:53:16 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-01 13:53:16 +0200 |
commit | fe5ede9792e3b4bbed05c10c534c8050e4208233 (patch) | |
tree | eee1fa0dd036b1f09b60140d72c6ff050a5b4383 /sys/src/cmd/mothra | |
parent | b408b386e1b996a8b5e6041e68c1801547b4487e (diff) |
mothra: fix double button hit
dolink() was hitting the button a second time!
Diffstat (limited to 'sys/src/cmd/mothra')
-rw-r--r-- | sys/src/cmd/mothra/mothra.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c index b35c08a1b..ddc696738 100644 --- a/sys/src/cmd/mothra/mothra.c +++ b/sys/src/cmd/mothra/mothra.c @@ -800,18 +800,8 @@ void doprev(Panel *p, int buttons, int index){ * Follow an html link */ void dolink(Panel *p, int buttons, Rtext *word){ - char *file, mapurl[NNAME]; - Point coord; - int yoffs; Action *a; - /* really a button, hit it */ - if(word->p != nil && word->p != p && strcmp(word->p->kind, "button") == 0){ - extern void pl_buttonhit(Panel *p, int buttons, int check); - pl_buttonhit(word->p, buttons, 0); - return; - } - a=word->user; if(a == nil || (a->link == nil && a->image == nil)) return; @@ -819,6 +809,10 @@ void dolink(Panel *p, int buttons, Rtext *word){ hiturl(buttons, a->image ? a->image : a->link, 0); else if(a->link){ if(a->ismap){ + char mapurl[NNAME]; + Point coord; + int yoffs; + yoffs=plgetpostextview(p); coord=subpt(subpt(mouse.xy, word->r.min), p->r.min); snprint(mapurl, sizeof(mapurl), "%s?%d,%d", a->link, coord.x, coord.y+yoffs); |