aboutsummaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/state.c b/src/state.c
index 880c8ff..7748e58 100644
--- a/src/state.c
+++ b/src/state.c
@@ -72,16 +72,16 @@ static bool anim_check_more(State *state, GList *btns)
Button *btn = it->data;
if (btn->anim != NULL) {
- bool draw = btn->anim->paint_func != NULL;
bool layout = btn->anim->layout_func != NULL;
+ bool before = btn->anim->before_func != NULL;
+ bool after = btn->anim->after_func != NULL;
- // Remove animation if both paint_func and layout_func finished
- if (!draw && !layout) {
+ // Remove animation if all functions finished
+ if (!layout && !before && !after) {
log_debug("Removing animation [type=%d, end=%ld, button=%p]",
btn->anim->type, btn->anim->start + btn->anim->duration, btn);
- animation_destroy(btn->anim);
- btn->anim = NULL;
+ g_clear_pointer(&btn->anim, animation_destroy);
} else {
more = true;
state->relayout |= layout;
@@ -110,6 +110,9 @@ static gboolean anim_handler(State *state)
return more;
}
+// FIXME: When spamming animations there seem to be occasional
+// race condition that block animations from playing
+// (the animation timeout eagerly quits)
void state_request_animation(State *state)
{
if (state->idle_id != 0) {