diff --git a/src/st/st-bin.c b/src/st/st-bin.c index 2eadd57ed..e96768626 100644 --- a/src/st/st-bin.c +++ b/src/st/st-bin.c @@ -358,6 +358,19 @@ st_bin_set_child (StBin *bin, if (priv->child == child) return; + if (child) + { + ClutterActor *parent = clutter_actor_get_parent (child); + + if (parent) + { + g_warning ("%s: The provided 'child' actor %p already has a " + "(different) parent %p and can't be made a child of %p.", + G_STRFUNC, child, parent, bin); + return; + } + } + if (priv->child) clutter_actor_remove_child (CLUTTER_ACTOR (bin), priv->child);