diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-22 10:02:22 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-22 10:05:17 -0400 |
commit | 1d802881eb3e4f2042efe9be51d74f0ae14d32b9 (patch) | |
tree | 3caf985dcf695dcc77e67b31a789b04b149659e8 | |
parent | e45dd771dbf4f3bb20f5269e08f55e3b1e7e9d9a (diff) | |
download | gtk+-1d802881eb3e4f2042efe9be51d74f0ae14d32b9.tar.gz |
stack: Change ordering for removal
Unparent the child widget before tearing down its
stack page. This is necessary so a11y can still access
the stack page accessible to emit change notification
when it learns that the child is removed.
-rw-r--r-- | gtk/gtkstack.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index b97ebb54bb..e1a24b7763 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -1467,16 +1467,12 @@ stack_remove (GtkStack *stack, if (child_info == NULL) return; - priv->children = g_list_remove (priv->children, child_info); - g_signal_handlers_disconnect_by_func (child, stack_child_visibility_notify_cb, stack); was_visible = gtk_widget_get_visible (child); - g_clear_object (&child_info->widget); - if (priv->visible_child == child_info) { if (in_dispose) @@ -1490,6 +1486,10 @@ stack_remove (GtkStack *stack, gtk_widget_unparent (child); + g_clear_object (&child_info->widget); + + priv->children = g_list_remove (priv->children, child_info); + g_object_unref (child_info); if (!in_dispose && |