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: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/768>
This commit is contained in:
Georges Basile Stavracas Neto
2026-05-20 13:45:52 -03:00
parent 298593456a
commit c9c455b6d8
+2 -1
View File
@@ -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);
}