diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d76064..9475062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ * `yambar --backend=wayland` always erroring out with _”yambar was compiled without the Wayland backend”_. +* Regression: `{where}` tag not being expanded in progress-bar + `on-click` handlers. ### Security diff --git a/particles/progress-bar.c b/particles/progress-bar.c index a825117..52d1e74 100644 --- a/particles/progress-bar.c +++ b/particles/progress-bar.c @@ -87,30 +87,6 @@ static void on_mouse(struct exposable *exposable, struct bar *bar, enum mouse_event event, enum mouse_button btn, int x, int y) { - if ((event == ON_MOUSE_MOTION && - exposable->particle->have_on_click_template) || - exposable->on_click[btn] != NULL) - { - exposable_default_on_mouse(exposable, bar, event, btn, x, y); - return; - } - - /* - * Hack-warning! - * - * In order to pass the *clicked* position to the on_click - * handler, we expand the handler *again* (first time would be - * when the particle instantiated us). - * - * We pass a single tag, "where", which is a percentage value. - * - * Keep a reference to the un-expanded string, to be able to reset - * it after executing the handler. - * - * Note that we only consider the actual progress bar to be - * clickable. This means we ignore the start and end markers. - */ - const struct particle *p = exposable->particle; const struct eprivate *e = exposable->private; @@ -150,6 +126,22 @@ on_mouse(struct exposable *exposable, struct bar *bar, enum mouse_event event, return; } + /* + * Hack-warning! + * + * In order to pass the *clicked* position to the on_click + * handler, we expand the handler *again* (first time would be + * when the particle instantiated us). + * + * We pass a single tag, "where", which is a percentage value. + * + * Keep a reference to the un-expanded string, to be able to + * reset it after executing the handler. + * + * Note that we only consider the actual progress bar to be + * clickable. This means we ignore the start and end markers. + */ + /* Remember the original handler, so that we can restore it */ char *original[MOUSE_BTN_COUNT]; for (size_t i = 0; i < MOUSE_BTN_COUNT; i++)