diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index a28e92bce9..ffcaafddd2 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -1924,6 +1924,7 @@ gtk_menu_popup_at_rect (GtkMenu *menu, const GdkEvent *trigger_event) { GtkMenuPrivate *priv; + GdkEvent *current_event = NULL; GdkDevice *device = NULL; guint button = 0; guint32 activate_time = GDK_CURRENT_TIME; @@ -1941,7 +1942,8 @@ gtk_menu_popup_at_rect (GtkMenu *menu, if (!trigger_event) { - trigger_event = gtk_get_current_event (); + current_event = gtk_get_current_event (); + trigger_event = current_event; } if (trigger_event) @@ -1962,6 +1964,8 @@ gtk_menu_popup_at_rect (GtkMenu *menu, NULL, button, activate_time); + + g_clear_object (¤t_event); } /**