From e9bbe8178ab45cb9880c9b6b0324e9b4467f26d5 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Sat, 25 Nov 2023 18:42:33 +0100 Subject: Recalculate layouts only when needed --- src/connect.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/connect.c') diff --git a/src/connect.c b/src/connect.c index 083d5a7..fa19ffb 100644 --- a/src/connect.c +++ b/src/connect.c @@ -126,12 +126,6 @@ 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; @@ -162,8 +156,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); - // Redraw - redraw(xsource->con->state); + state_redraw(xsource->con->state, true); break; } @@ -203,8 +196,7 @@ static gboolean source_dispatch(GSource *source, GSourceFunc callback, gpointer update_xrm(xsource->con); update_scale(xsource->con); - // Redraw - redraw(xsource->con->state); + state_redraw(xsource->con->state, true); } break; } -- cgit v1.2.3