aboutsummaryrefslogtreecommitdiff
path: root/src/connect.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2023-11-19 22:28:35 +0100
committerFederico Angelilli <code@fedang.net>2023-11-19 22:28:35 +0100
commit7bb670a21a3e6234ac70a031ecc164159559285a (patch)
treeeb3d59c466049ec72ac88abd9335cf96a4835e1e /src/connect.c
parent89b205f3138b94325458ab121d5adb4a00091860 (diff)
Add date buttons with periodic updates
Diffstat (limited to 'src/connect.c')
-rw-r--r--src/connect.c10
1 files changed, 8 insertions, 2 deletions
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;
}