[gtk/wip/matthiasc/context-menu: 22/29] text: Fix selection bubble handling



commit 4c0a3aab3ee005daecbd43dc14c47ddfbaf25439
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 10 21:40:14 2019 +0000

    text: Fix selection bubble handling
    
    Same fix as the previous commit.

 gtk/gtktext.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 6bcdc024dc..cb0ea72d86 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1763,7 +1763,7 @@ gtk_text_finalize (GObject *object)
 
   g_clear_object (&priv->cached_layout);
   g_clear_object (&priv->im_context);
-  g_clear_pointer (&priv->selection_bubble, gtk_widget_destroy);
+  g_clear_pointer (&priv->selection_bubble, gtk_widget_unparent);
   g_clear_pointer (&priv->magnifier_popover, gtk_widget_destroy);
   g_clear_object (&priv->text_handle);
   g_free (priv->im_module);
@@ -5876,8 +5876,7 @@ gtk_text_selection_bubble_popup_show (gpointer user_data)
       return G_SOURCE_REMOVE;
     }
 
-  if (priv->selection_bubble)
-    gtk_widget_destroy (priv->selection_bubble);
+  g_clear_pointer (&priv->selection_bubble, gtk_widget_unparent);
 
   priv->selection_bubble = gtk_popover_new (GTK_WIDGET (self));
   gtk_style_context_add_class (gtk_widget_get_style_context (priv->selection_bubble),


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