From 90d533c1a3f7e6e24eb308b355aaabf95bb3c4c3 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 22 Apr 2004 14:29:50 +0000 Subject: Fixes #56092 2004-04-22 JP Rosevear Fixes #56092 * gui/e-day-view.c (e_day_view_show_popup_menu): weak ref for the menu to be destroyed (popup_destroyed_cb): reset popup_event_num and popup_event_day * gui/e-week-view.c (e_week_view_show_popup_menu): weak ref for the menu to be destroyed (popup_destroyed_cb): reset the popup_event_num svn path=/trunk/; revision=25583 --- calendar/gui/e-day-view.c | 10 ++++++++++ calendar/gui/e-week-view.c | 9 +++++++++ 2 files changed, 19 insertions(+) (limited to 'calendar/gui') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 4aa223228c..b3f65de4b3 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3268,6 +3268,15 @@ e_day_view_on_event_double_click (EDayView *day_view, event->comp_data->icalcomp, FALSE); } +static void +popup_destroyed_cb (gpointer data, GObject *where_object_was) +{ + EDayView *day_view = data; + + day_view->popup_event_day = -1; + day_view->popup_event_num = -1; +} + static void e_day_view_show_popup_menu (EDayView *day_view, GdkEvent *gdk_event, @@ -3280,6 +3289,7 @@ e_day_view_show_popup_menu (EDayView *day_view, day_view->popup_event_num = event_num; popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (day_view)); + g_object_weak_ref (G_OBJECT (popup), popup_destroyed_cb, day_view); e_popup_menu (popup, gdk_event); } diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 5feb39bfbb..00dc957248 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -3703,6 +3703,14 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event) return handled; } +static void +popup_destroyed_cb (gpointer data, GObject *where_object_was) +{ + EWeekView *week_view = data; + + week_view->popup_event_num = -1; +} + void e_week_view_show_popup_menu (EWeekView *week_view, GdkEventButton *bevent, @@ -3713,6 +3721,7 @@ e_week_view_show_popup_menu (EWeekView *week_view, week_view->popup_event_num = event_num; popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (week_view)); + g_object_weak_ref (G_OBJECT (popup), popup_destroyed_cb, week_view); e_popup_menu (popup, (GdkEvent *) bevent); } -- cgit v1.2.3