mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
clutter/stage: Stop using DELEGATE_LAYOUT allocation flag
We're going to remove allocation flags, so stop depending on the DELEGATE_LAYOUT flag in ClutterStage and call clutter_layout_manager_allocate() directly, which is pretty straightforward. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245
This commit is contained in:
parent
c8837a8de5
commit
4729cb779e
@ -622,6 +622,7 @@ clutter_stage_allocate (ClutterActor *self,
|
|||||||
float new_width, new_height;
|
float new_width, new_height;
|
||||||
float width, height;
|
float width, height;
|
||||||
cairo_rectangle_int_t window_size;
|
cairo_rectangle_int_t window_size;
|
||||||
|
ClutterLayoutManager *layout_manager = clutter_actor_get_layout_manager (self);
|
||||||
|
|
||||||
if (priv->impl == NULL)
|
if (priv->impl == NULL)
|
||||||
return;
|
return;
|
||||||
@ -643,6 +644,12 @@ clutter_stage_allocate (ClutterActor *self,
|
|||||||
*/
|
*/
|
||||||
if (!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
|
if (!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
|
||||||
{
|
{
|
||||||
|
ClutterActorBox children_box;
|
||||||
|
|
||||||
|
children_box.x1 = children_box.y1 = 0.f;
|
||||||
|
children_box.x2 = box->x2 - box->x1;
|
||||||
|
children_box.y2 = box->y2 - box->y1;
|
||||||
|
|
||||||
CLUTTER_NOTE (LAYOUT,
|
CLUTTER_NOTE (LAYOUT,
|
||||||
"Following allocation to %.2fx%.2f (absolute origin %s)",
|
"Following allocation to %.2fx%.2f (absolute origin %s)",
|
||||||
width, height,
|
width, height,
|
||||||
@ -650,8 +657,12 @@ clutter_stage_allocate (ClutterActor *self,
|
|||||||
? "changed"
|
? "changed"
|
||||||
: "not changed");
|
: "not changed");
|
||||||
|
|
||||||
clutter_actor_set_allocation (self, box,
|
clutter_actor_set_allocation (self, box, flags);
|
||||||
flags | CLUTTER_DELEGATE_LAYOUT);
|
|
||||||
|
clutter_layout_manager_allocate (layout_manager,
|
||||||
|
CLUTTER_CONTAINER (self),
|
||||||
|
&children_box,
|
||||||
|
flags);
|
||||||
|
|
||||||
/* Ensure the window is sized correctly */
|
/* Ensure the window is sized correctly */
|
||||||
if (priv->min_size_changed)
|
if (priv->min_size_changed)
|
||||||
@ -707,8 +718,12 @@ clutter_stage_allocate (ClutterActor *self,
|
|||||||
: "not changed");
|
: "not changed");
|
||||||
|
|
||||||
/* and store the overridden allocation */
|
/* and store the overridden allocation */
|
||||||
clutter_actor_set_allocation (self, &override,
|
clutter_actor_set_allocation (self, &override, flags);
|
||||||
flags | CLUTTER_DELEGATE_LAYOUT);
|
|
||||||
|
clutter_layout_manager_allocate (layout_manager,
|
||||||
|
CLUTTER_CONTAINER (self),
|
||||||
|
&override,
|
||||||
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset the viewport if the allocation effectively changed */
|
/* reset the viewport if the allocation effectively changed */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user