From c7a8b75933b3bd963e19f1a9d85f3b610a08e669 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Thu, 14 Mar 2024 15:44:41 +0100 Subject: Change animation code and refactor state --- src/connect.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/connect.c') diff --git a/src/connect.c b/src/connect.c index d5d4f12..1a21be3 100644 --- a/src/connect.c +++ b/src/connect.c @@ -97,13 +97,14 @@ static void button_action(State *state, const char *event, int x, int y) ButtonAction action = button_simple_get_action(layout->btn); if (action != NULL) { - action(layout->btn); + Animation *shine = animation_shine_create(500 * G_TIME_SPAN_MILLISECOND); - Animation *shine = animation_shine_create(state, 500 * G_TIME_SPAN_MILLISECOND); if (button_set_animation(layout->btn, shine)) - button_start_animation(layout->btn); + state_request_animation(state); else animation_destroy(shine); + + action(layout->btn); } return; @@ -169,7 +170,7 @@ static gboolean source_dispatch(GSource *source, GSourceFunc callback, gpointer xcb_expose_event_t *expose = (xcb_expose_event_t *)xsource->event; log_debug("Processing event 'Expose' [type=%d]", XCB_EXPOSE); - state_redraw(xsource->con->state, true); + state_request_redraw(xsource->con->state, true); break; } @@ -217,7 +218,7 @@ static gboolean source_dispatch(GSource *source, GSourceFunc callback, gpointer update_xrm(xsource->con); update_scale(xsource->con); - state_redraw(xsource->con->state, true); + state_request_redraw(xsource->con->state, true); } break; } -- cgit v1.2.3