From 1cdbe8dbda4d0e977f1e2958102d57b4630b91e5 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 20 Mar 1998 05:41:30 +0000 Subject: [PATCH] 1998-03-19 Federico Mena Quintero * gdesktop.c (desktop_icon_context_popup): It is not necessary to set the menu position. (desktop_icon_context_popup): gtk_signal_connect_object_after to the menu items with gtk_widget_destroy as a callback so that we can destroy the menu widget appropriately. --- gnome/ChangeLog | 8 ++++++++ gnome/gdesktop.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index ace92d1c0..607725d41 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,11 @@ +1998-03-19 Federico Mena Quintero + + * gdesktop.c (desktop_icon_context_popup): It is not necessary to + set the menu position. + (desktop_icon_context_popup): gtk_signal_connect_object_after to the menu + items with gtk_widget_destroy as a callback so that we can destroy + the menu widget appropriately. + 1998-03-19 Miguel de Icaza * gscreen.c (display_mini_info): Implement mini status. diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index f7960389d..45590eb51 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -691,20 +691,24 @@ desktop_icon_context_popup (GdkEventButton *event, desktop_icon_t *di) menu = gtk_menu_new (); + /* We connect_object_after to the items so that we can destroy + * the menu at the proper time. + */ + item = gtk_menu_item_new_with_label (_("Properties")); gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (icon_properties), di); + gtk_signal_connect_object_after (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (gtk_widget_destroy), menu); gtk_menu_append (GTK_MENU (menu), item); gtk_widget_show (item); item = gtk_menu_item_new_with_label (_("Delete")); gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (icon_delete), di); + gtk_signal_connect_object_after (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (gtk_widget_destroy), menu); gtk_menu_append (GTK_MENU (menu), item); gtk_widget_show (item); - - gtk_widget_set_uposition (menu, event->x, event->y); - gtk_signal_connect (GTK_OBJECT (menu), "deactivate", GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, 0, NULL, 3, event->time); }