particle/string: expand on_click handler before passing to exposable

This commit is contained in:
Daniel Eklöf 2018-12-29 17:10:10 +01:00
parent aee4805df8
commit 85801a5deb

View file

@ -87,12 +87,17 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
e->font = p->font;
e->foreground = p->foreground;
struct exposable *exposable = exposable_common_new(
particle, particle->on_click_template);
char *on_click = particle->on_click_template != NULL
? tags_expand_template(particle->on_click_template, tags)
: NULL;
struct exposable *exposable = exposable_common_new(particle, on_click);
exposable->private = e;
exposable->destroy = &exposable_destroy;
exposable->begin_expose = &begin_expose;
exposable->expose = &expose;
free(on_click);
return exposable;
}