week-view: also check for realized

Be more strict about the checks, and avoid crashes.
This commit is contained in:
Georges Basile Stavracas Neto
2017-03-14 15:53:09 -03:00
parent 8102912541
commit 180621cd91
+5 -2
View File
@@ -145,8 +145,11 @@ update_grid_scroll_position (GcalWeekView *self)
gdouble max, page, page_increment, value;
/* While the scrolled window is not mapped, we keep waiting */
if (!gtk_widget_get_mapped (self->scrolled_window))
return G_SOURCE_CONTINUE;
if (!gtk_widget_get_realized (self->scrolled_window) ||
!gtk_widget_get_mapped (self->scrolled_window))
{
return G_SOURCE_CONTINUE;
}
now = g_date_time_new_now_local ();
week_start = get_start_of_week (self->date);