[gtk+] range: Don't leave css nodes behind
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] range: Don't leave css nodes behind
- Date: Tue, 1 Mar 2016 20:48:34 +0000 (UTC)
commit cb614cc8388bfde71928bbc29fe45456d216c154
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 1 15:48:01 2016 -0500
range: Don't leave css nodes behind
We create and destroy gadgets inside the range hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
gtk/gtkrange.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index bbfd3bc..c8d6129 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -1568,6 +1568,7 @@ gtk_range_set_show_fill_level (GtkRange *range,
}
else
{
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->fill_gadget), NULL);
g_clear_object (&priv->fill_gadget);
}
@@ -3807,6 +3808,7 @@ _gtk_range_set_has_origin (GtkRange *range,
}
else
{
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->highlight_gadget), NULL);
g_clear_object (&priv->highlight_gadget);
}
}
@@ -3917,7 +3919,10 @@ sync_stepper_gadget (GtkRange *range,
if (!should_have_stepper)
{
if (*gadget_ptr != NULL)
- gtk_box_gadget_remove_gadget (GTK_BOX_GADGET (priv->contents_gadget), *gadget_ptr);
+ {
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (*gadget_ptr), NULL);
+ gtk_box_gadget_remove_gadget (GTK_BOX_GADGET (priv->contents_gadget), *gadget_ptr);
+ }
g_clear_object (gadget_ptr);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]