From a59599ca0ea97ff01b14129930f7999e3574fb12 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 11 Oct 2011 13:11:30 -0400 Subject: Bug 661399 - Crash when hovering over calendar entry --- calendar/gui/e-calendar-view.c | 16 ++++++++++------ calendar/gui/e-calendar-view.h | 3 +-- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'calendar') diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 84046e7aac..0da5afc618 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1826,8 +1826,7 @@ e_calendar_view_move_tip (GtkWidget *widget, */ gboolean -e_calendar_view_get_tooltips (ECalendarView *cal_view, - const ECalendarViewEventData *data) +e_calendar_view_get_tooltips (const ECalendarViewEventData *data) { GtkWidget *label, *box, *hbox, *ebox, *frame; const gchar *str; @@ -1838,7 +1837,7 @@ e_calendar_view_get_tooltips (ECalendarView *cal_view, time_t t_start, t_end; ECalendarViewEvent *pevent; GtkStyle *style = gtk_widget_get_default_style (); - GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (data->cal_view), "tooltip-window"); + GtkWidget *widget; GdkWindow *window; ECalComponent *newcomp = e_cal_component_new (); icaltimezone *zone, *default_zone; @@ -1846,12 +1845,17 @@ e_calendar_view_get_tooltips (ECalendarView *cal_view, ECalClient *client = NULL; gboolean free_text = FALSE; - g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE); + /* This function is a timeout callback. */ - model = e_calendar_view_get_model (cal_view); + g_return_val_if_fail (data != NULL, FALSE); + g_return_val_if_fail (E_IS_CALENDAR_VIEW (data->cal_view), FALSE); + + model = e_calendar_view_get_model (data->cal_view); /* Delete any stray tooltip if left */ - if (widget) + widget = g_object_get_data ( + G_OBJECT (data->cal_view), "tooltip-window"); + if (GTK_IS_WIDGET (widget)) gtk_widget_destroy (widget); default_zone = e_calendar_view_get_timezone (data->cal_view); diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index 7ebcef7d1c..8d54275d1d 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -248,8 +248,7 @@ void e_calendar_view_modify_and_send (ECalendarView *cal_view, GtkWindow *toplevel, gboolean new); -gboolean e_calendar_view_get_tooltips (ECalendarView *cal_view, - const ECalendarViewEventData *data); +gboolean e_calendar_view_get_tooltips (const ECalendarViewEventData *data); void e_calendar_view_move_tip (GtkWidget *widget, gint x, -- cgit