Commit d1ca0e1b authored by Emmanuele Bassi's avatar Emmanuele Bassi

fixed layout: Store a back pointer to the Container

When set_container() is called with a NULL container we cannot use the
passed pointer to unset the CLUTTER_ACTOR_NO_LAYOUT flag. We should
store a back pointer to the container as object data (there's no need
to add a Private data structure in this case) and unset the flag on the
back pointer instead.
parent 3a9d8421
......@@ -156,8 +156,10 @@ void
clutter_fixed_layout_set_container (ClutterLayoutManager *manager,
ClutterContainer *container)
{
if (container)
if (container != NULL)
{
g_object_set_data (G_OBJECT (manager), "fixed-container", container);
/* signal Clutter that we don't impose any layout on
* our children, so we can shave off some relayout
* operations
......@@ -165,7 +167,15 @@ clutter_fixed_layout_set_container (ClutterLayoutManager *manager,
CLUTTER_ACTOR_SET_FLAGS (container, CLUTTER_ACTOR_NO_LAYOUT);
}
else
CLUTTER_ACTOR_UNSET_FLAGS (container, CLUTTER_ACTOR_NO_LAYOUT);
{
gpointer old_container;
old_container = g_object_get_data (G_OBJECT (manager), "fixed-container");
if (old_container != NULL)
CLUTTER_ACTOR_UNSET_FLAGS (old_container, CLUTTER_ACTOR_NO_LAYOUT);
g_object_set_data (G_OBJECT (manager), "fixed-container", NULL);
}
}
static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment