aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-10 21:00:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-10 21:00:56 +0800
commit8734644b43e1e1854ee1f004f42e220d8a2fb0b8 (patch)
treef82108e58e921d40aa4e4ce2b5639098161c32e1
parentb3cdd1cc301540d00fe1a501c5e2b5332d8869b7 (diff)
downloadgsoc2013-evolution-8734644b43e1e1854ee1f004f42e220d8a2fb0b8.tar.gz
gsoc2013-evolution-8734644b43e1e1854ee1f004f42e220d8a2fb0b8.tar.zst
gsoc2013-evolution-8734644b43e1e1854ee1f004f42e220d8a2fb0b8.zip
Bug 624011 - EMeetingTimeSelector tries to change mouse cursor before it's realized
-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