aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-07-25 23:06:14 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:38 +0800
commit7137e19f2e44788ba8501534b9e46bc8c54e78c4 (patch)
treea13237786b51caeca38881d08903e28cd1f02292 /widgets
parent4444572c399ef1b89d52eaa04c81cf1d45ddbf00 (diff)
downloadgsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.tar
gsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.tar.gz
gsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.tar.bz2
gsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.tar.lz
gsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.tar.xz
gsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.tar.zst
gsoc2013-evolution-7137e19f2e44788ba8501534b9e46bc8c54e78c4.zip
Bug #654889 - Closes when clicking on year/month selector
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-calendar-item.c24
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