aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/e-meeting-time-sel.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 4c19b5a3aa..a34033f44b 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -1468,8 +1468,6 @@ void
e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint row, gboolean all)
{
EMeetingTime start, end;
- GdkCursor *cursor;
- GdkWindow *window;
/* nothing to refresh, lets not leak a busy cursor */
if (e_meeting_store_count_actual_attendees (mts->model) <= 0)
@@ -1484,14 +1482,22 @@ e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint row,
end.hour = 0;
end.minute = 0;
- /* set the cursor to Busy, We need to reset it to normal once the free busy
- queries are complete */
- cursor = gdk_cursor_new (GDK_WATCH);
- window = gtk_widget_get_window (GTK_WIDGET (mts));
- gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ /* XXX This function is called during schedule page initialization
+ * before the meeting time selector is realized, meaning it has
+ * no GdkWindow yet. This avoids a runtime warning. */
+ if (gtk_widget_get_realized (GTK_WIDGET (mts))) {
+ GdkCursor *cursor;
+ GdkWindow *window;
- mts->last_cursor_set = GDK_WATCH;
+ /* Set the cursor to Busy. We need to reset it to
+ * normal once the free busy queries are complete. */
+ cursor = gdk_cursor_new (GDK_WATCH);
+ window = gtk_widget_get_window (GTK_WIDGET (mts));
+ gdk_window_set_cursor (window, cursor);
+ gdk_cursor_unref (cursor);
+
+ mts->last_cursor_set = GDK_WATCH;
+ }
/* Ref ourselves in case we are called back after destruction,
* we can do this because we will get a call back even after