diff options
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/state.c b/src/state.c index 0f17695..f35faa2 100644 --- a/src/state.c +++ b/src/state.c @@ -67,7 +67,16 @@ void state_request_redraw(State *state, bool relayout) static gboolean anim_handler(State *state) { - //log_debug("Animating [relayout=%d]", state->relayout); + bool anim = false; + for (GList *it = state->btns; it != NULL; it = it->next) { + Button *btn = it->data; + if (btn->anim != NULL) { + anim = true; + state->relayout |= btn->anim->layout_func != NULL; + } + } + + log_debug("Animating [relayout=%d]", state->relayout); if (state->relayout) { draw_compute_layout(state->draw, state->win, state->btns); @@ -75,12 +84,7 @@ static gboolean anim_handler(State *state) } draw_paint(state->draw, state->win); - - for (GList *it = state->btns; it != NULL; it = it->next) { - Button *btn = it->data; - if (btn->anim != NULL) - return G_SOURCE_CONTINUE; - } + if (anim) return G_SOURCE_CONTINUE; state->anim_id = 0; return G_SOURCE_REMOVE; |
