diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-14 15:44:41 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-14 15:44:41 +0100 |
| commit | c7a8b75933b3bd963e19f1a9d85f3b610a08e669 (patch) | |
| tree | 91de053f1caaf655eaeb1bbd3458c49362b22e2a /src/connect.c | |
| parent | 93c4dc6893e733f563e70c315537922d55adfab2 (diff) | |
Change animation code and refactor state
Diffstat (limited to 'src/connect.c')
| -rw-r--r-- | src/connect.c | 11 |
1 files changed, 6 insertions, 5 deletions
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; } |
