From c9c455b6d80abfab6bf6c9176034ba6d0062f030 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 20 May 2026 13:45:52 -0300 Subject: [PATCH] views/month: Only recalculate layout blocks when needed The tick callback can be fired *after* the GtkWidget.map() vfunc is called, in which case the recalculate_layout_blocks() will run with an already recalculated layout, which is invalid. Only call recalculate_layout_blocks() when the blocks are invalidated. Part-of: --- src/gui/views/gcal-month-view-row.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/views/gcal-month-view-row.c b/src/gui/views/gcal-month-view-row.c index acf1ee39..9c07345a 100644 --- a/src/gui/views/gcal-month-view-row.c +++ b/src/gui/views/gcal-month-view-row.c @@ -930,7 +930,8 @@ widget_tick_cb (GtkWidget *widget, g_assert (GCAL_IS_MONTH_VIEW_ROW (self)); - recalculate_layout_blocks (self); + if (!self->layout_blocks_valid) + recalculate_layout_blocks (self); GCAL_RETURN (G_SOURCE_REMOVE); }