From 85801a5deb4c81e54d0f86711f505b4ae2c9b928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 29 Dec 2018 17:10:10 +0100 Subject: [PATCH] particle/string: expand on_click handler before passing to exposable --- particles/string.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/particles/string.c b/particles/string.c index fbe568a..47ced4e 100644 --- a/particles/string.c +++ b/particles/string.c @@ -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; }