From 7bb670a21a3e6234ac70a031ecc164159559285a Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Sun, 19 Nov 2023 22:28:35 +0100 Subject: Add date buttons with periodic updates --- src/connect.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/connect.c') diff --git a/src/connect.c b/src/connect.c index bc45812..083d5a7 100644 --- a/src/connect.c +++ b/src/connect.c @@ -126,6 +126,12 @@ static gboolean source_check(GSource *source) return xsource->event != NULL; } +static void redraw(State *state) +{ + draw_compute_layout(state->draw, state->win, state->btns); + draw_paint(state->draw, state->win); +} + static gboolean source_dispatch(GSource *source, GSourceFunc callback, gpointer data) { EventSource *xsource = (EventSource *)source; @@ -157,7 +163,7 @@ static gboolean source_dispatch(GSource *source, GSourceFunc callback, gpointer log_debug("Processing event 'Expose' [type=%d]", XCB_EXPOSE); // Redraw - draw_paint(xsource->con->state->draw, xsource->con->state->win); + redraw(xsource->con->state); break; } @@ -198,7 +204,7 @@ static gboolean source_dispatch(GSource *source, GSourceFunc callback, gpointer update_scale(xsource->con); // Redraw - draw_paint(xsource->con->state->draw, xsource->con->state->win); + redraw(xsource->con->state); } break; } -- cgit v1.2.3