mirror of
https://github.com/brl/mutter.git
synced 2025-01-24 18:39:09 +00:00
Add more checks to ClutterContainer::raise() and ::lower()
Check that the actors passed are actually children of the container, as the implementations assume this.
This commit is contained in:
parent
a60dcb9889
commit
adfa359e48
@ -422,6 +422,25 @@ clutter_container_raise (ClutterContainer *container,
|
|||||||
if (actor == sibling)
|
if (actor == sibling)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (clutter_actor_get_parent (actor) != CLUTTER_ACTOR (container))
|
||||||
|
{
|
||||||
|
g_warning ("Actor of type `%s' is not a child of the container "
|
||||||
|
"of type `%s'",
|
||||||
|
g_type_name (G_OBJECT_TYPE (actor)),
|
||||||
|
g_type_name (G_OBJECT_TYPE (container)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sibling &&
|
||||||
|
clutter_actor_get_parent (sibling) != CLUTTER_ACTOR (container))
|
||||||
|
{
|
||||||
|
g_warning ("Actor of type `%s' is not a child of the container "
|
||||||
|
"of type `%s'",
|
||||||
|
g_type_name (G_OBJECT_TYPE (sibling)),
|
||||||
|
g_type_name (G_OBJECT_TYPE (container)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling);
|
CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,6 +466,25 @@ clutter_container_lower (ClutterContainer *container,
|
|||||||
if (actor == sibling)
|
if (actor == sibling)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (clutter_actor_get_parent (actor) != CLUTTER_ACTOR (container))
|
||||||
|
{
|
||||||
|
g_warning ("Actor of type `%s' is not a child of the container "
|
||||||
|
"of type `%s'",
|
||||||
|
g_type_name (G_OBJECT_TYPE (actor)),
|
||||||
|
g_type_name (G_OBJECT_TYPE (container)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sibling &&
|
||||||
|
clutter_actor_get_parent (sibling) != CLUTTER_ACTOR (container))
|
||||||
|
{
|
||||||
|
g_warning ("Actor of type `%s' is not a child of the container "
|
||||||
|
"of type `%s'",
|
||||||
|
g_type_name (G_OBJECT_TYPE (sibling)),
|
||||||
|
g_type_name (G_OBJECT_TYPE (container)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling);
|
CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user