diff options
| author | Federico Angelilli <code@fedang.net> | 2023-11-25 18:42:33 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-11-25 18:44:03 +0100 |
| commit | e9bbe8178ab45cb9880c9b6b0324e9b4467f26d5 (patch) | |
| tree | 62a9dc864731f22d3c89d3bd54036abb4661ef7c /src/connect.c | |
| parent | 14b4c8084c14ba7a6e34cafb6c9a22a330f57644 (diff) | |
Recalculate layouts only when needed
Diffstat (limited to 'src/connect.c')
| -rw-r--r-- | src/connect.c | 12 |
1 files changed, 2 insertions, 10 deletions
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; } |
