widget: root child before emitting child observer signals

Try to avoid the childen_observer signal handlers screwing up internal
state.

Fixes #3364
This commit is contained in:
Timm Bäder 2020-11-19 12:00:40 +01:00 committed by Matthias Clasen
parent 5f4beb711f
commit 2d43ecf8ca

View File

@ -5776,6 +5776,9 @@ gtk_widget_reposition_after (GtkWidget *widget,
_gtk_widget_update_parent_muxer (widget);
if (parent->priv->root && priv->root == NULL)
gtk_widget_root (widget);
if (parent->priv->children_observer)
{
if (prev_previous)
@ -5784,9 +5787,6 @@ gtk_widget_reposition_after (GtkWidget *widget,
gtk_list_list_model_item_added (parent->priv->children_observer, widget);
}
if (parent->priv->root && priv->root == NULL)
gtk_widget_root (widget);
if (prev_parent == NULL)
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);