[gtk/wip/matthiasc/context-menu] text view: Fix selection bubble handling
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/context-menu] text view: Fix selection bubble handling
- Date: Tue, 11 Jun 2019 03:08:33 +0000 (UTC)
commit 565a54446cf32d023a9ba4473f7c292d6fed05d2
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 10 21:39:14 2019 +0000
text view: Fix selection bubble handling
We can't call gtk_widget_destroy on something
that wasn't added as a child to a container -
it ends up calling gtk_container_remove, which
asserts if it doesn't find the child.
gtk/gtktextview.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 97fa733f66..abfee66997 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -3605,8 +3605,7 @@ gtk_text_view_finalize (GObject *object)
if (priv->bottom_window)
text_window_free (priv->bottom_window);
- if (priv->selection_bubble)
- gtk_widget_destroy (priv->selection_bubble);
+ g_clear_pointer (&priv->selection_bubble, gtk_widget_unparent);
if (priv->magnifier_popover)
gtk_widget_destroy (priv->magnifier_popover);
@@ -8898,8 +8897,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
priv->selection_bubble_timeout_id = 0;
- 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 (text_view));
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]