diff options
author | Vincent Untz <vuntz@gnome.org> | 2011-06-28 11:47:37 +0200 |
---|---|---|
committer | Vincent Untz <vuntz@gnome.org> | 2011-06-30 09:11:28 +0200 |
commit | 8cb0cc58e321641ebda699b9cbdc0067aeb56d3f (patch) | |
tree | 4d78ba06f15d0184809cb24797ee509a238026db /gtk | |
parent | 9c4892f2915b9984bf8252d4bc93a864883d82c2 (diff) | |
download | gtk+-8cb0cc58e321641ebda699b9cbdc0067aeb56d3f.tar.gz |
gtkbox: Invalidate order on changes, even if the child is not visible
When we build the sibling path for the order, we do not skip hidden
children (since, quoting the comment, "we cannot reliably detect changes
in widget visibility"). So we need to invalidate the order when hidden
children are reordered and removed.
https://bugzilla.gnome.org/show_bug.cgi?id=652769
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkbox.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index f97a80d583..b711a52aa5 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -1612,10 +1612,12 @@ gtk_box_reorder_child (GtkBox *box, priv->children = g_list_insert_before (priv->children, new_link, child_info); gtk_widget_child_notify (child, "position"); + + gtk_box_invalidate_order (box); + if (gtk_widget_get_visible (child) && gtk_widget_get_visible (GTK_WIDGET (box))) { - gtk_box_invalidate_order (box); gtk_widget_queue_resize (child); } } @@ -1799,12 +1801,13 @@ gtk_box_remove (GtkContainer *container, g_list_free (children); g_free (child); + gtk_box_invalidate_order (box); + /* queue resize regardless of gtk_widget_get_visible (container), * since that's what is needed by toplevels. */ if (was_visible) { - gtk_box_invalidate_order (box); gtk_widget_queue_resize (GTK_WIDGET (container)); } |