[gnome-builder/wip/gtk4-port: 263/1774] libide/tree: keep popover around for display




commit 352620947dd7b581f5ad1278840aa5fbcfbfe477
Author: Christian Hergert <chergert redhat com>
Date:   Thu Mar 31 02:53:54 2022 -0700

    libide/tree: keep popover around for display

 src/libide/tree/ide-tree.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/libide/tree/ide-tree.c b/src/libide/tree/ide-tree.c
index 837e252fc..d38f6d107 100644
--- a/src/libide/tree/ide-tree.c
+++ b/src/libide/tree/ide-tree.c
@@ -703,10 +703,21 @@ ide_tree_show_popover_at_node (IdeTree     *self,
                                IdeTreeNode *node,
                                GtkPopover  *popover)
 {
+  IdeTreePrivate *priv = ide_tree_get_instance_private (self);
+
   g_return_if_fail (IDE_IS_TREE (self));
   g_return_if_fail (IDE_IS_TREE_NODE (node));
   g_return_if_fail (GTK_IS_POPOVER (popover));
 
+  g_clear_pointer ((GtkWidget **)&priv->popover, gtk_widget_unparent);
+  priv->popover = popover;
+  gtk_widget_set_parent (GTK_WIDGET (popover), GTK_WIDGET (self));
+  g_signal_connect_object (popover,
+                           "closed",
+                           G_CALLBACK (ide_tree_popover_closed_cb),
+                           self,
+                           G_CONNECT_SWAPPED);
+
   _ide_tree_node_show_popover (node, self, popover);
 }
 


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