mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 05:44:08 +00:00
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.
This commit is contained in:
parent
3a9d842164
commit
d1ca0e1b8f
@ -156,8 +156,10 @@ void
|
|||||||
clutter_fixed_layout_set_container (ClutterLayoutManager *manager,
|
clutter_fixed_layout_set_container (ClutterLayoutManager *manager,
|
||||||
ClutterContainer *container)
|
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
|
/* signal Clutter that we don't impose any layout on
|
||||||
* our children, so we can shave off some relayout
|
* our children, so we can shave off some relayout
|
||||||
* operations
|
* operations
|
||||||
@ -165,7 +167,15 @@ clutter_fixed_layout_set_container (ClutterLayoutManager *manager,
|
|||||||
CLUTTER_ACTOR_SET_FLAGS (container, CLUTTER_ACTOR_NO_LAYOUT);
|
CLUTTER_ACTOR_SET_FLAGS (container, CLUTTER_ACTOR_NO_LAYOUT);
|
||||||
}
|
}
|
||||||
else
|
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
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user