[gnome-builder/gnome-builder-3-20] tree: destroy menu after selection has finished



commit 35e3814a2e3898990de2dead02cb50fb69730635
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 4 11:07:09 2016 +0300

    tree: destroy menu after selection has finished
    
    We were not destroying the GtkMenu after use, so it would continue to
    show up in the inspector as an invisible widget.

 libide/ide-tree.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-tree.c b/libide/ide-tree.c
index f50da50..b58edba 100644
--- a/libide/ide-tree.c
+++ b/libide/ide-tree.c
@@ -317,10 +317,18 @@ ide_tree_popup (IdeTree        *self,
       gtk_menu_attach_to_widget (GTK_MENU (menu_widget),
                                  GTK_WIDGET (self),
                                  NULL);
+      g_signal_connect_after (menu_widget,
+                              "selection-done",
+                              G_CALLBACK (gtk_widget_destroy),
+                              NULL);
       gtk_menu_popup (GTK_MENU (menu_widget), NULL, NULL,
                       ide_tree_menu_position_func, &loc,
                       button, event_time);
     }
+  else
+    {
+      gtk_widget_destroy (menu_widget);
+    }
 
   IDE_EXIT;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]