ref: 5ab58284a5cfa423a800002dc9727746d8aa277c
parent: 099c7fd2a035456962e49db9e20fbaf307f85613
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Aug 1 09:53:16 EDT 2015
mothra: fix double button hit dolink() was hitting the button a second time!
--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -800,18 +800,8 @@
* 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 @@
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);
--
⑨