diff options
author | Milan Crha <mcrha@redhat.com> | 2011-07-25 23:06:14 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-07-25 23:06:14 +0800 |
commit | f756151e19d3e8e7435e5f4dc6a515acad85f22e (patch) | |
tree | 93185eecb4f5ad0d41d9f0d62fe38b05d2e9ec60 /widgets/misc | |
parent | fbee43e5924cee79690e5ba16c2341eabfdecd3c (diff) | |
download | gsoc2013-evolution-f756151e19d3e8e7435e5f4dc6a515acad85f22e.tar.gz gsoc2013-evolution-f756151e19d3e8e7435e5f4dc6a515acad85f22e.tar.zst gsoc2013-evolution-f756151e19d3e8e7435e5f4dc6a515acad85f22e.zip |
Bug #654889 - Closes when clicking on year/month selector
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-calendar-item.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index fd626c674c..400fbe2c64 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -3331,6 +3331,22 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, return need_update; } +static gboolean +destroy_menu_idle_cb (gpointer menu) +{ + gtk_widget_destroy (menu); + + return FALSE; +} + +static void +deactivate_menu_cb (GtkWidget *menu) +{ + g_signal_handlers_disconnect_by_func (menu, deactivate_menu_cb, NULL); + + g_idle_add (destroy_menu_idle_cb, menu); +} + static void e_calendar_item_show_popup_menu (ECalendarItem *calitem, GdkEventButton *event, @@ -3377,16 +3393,10 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, } } - /* Run the menu modal so we can destroy it after. */ - g_signal_connect((menu), "deactivate", - G_CALLBACK (gtk_main_quit), NULL); + g_signal_connect (menu, "deactivate", G_CALLBACK (deactivate_menu_cb), NULL); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, e_calendar_item_position_menu, calitem, event->button, event->time); - gtk_grab_add (menu); - gtk_main (); - gtk_grab_remove (menu); - gtk_widget_destroy (menu); } static void |