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:
Jonas Dreßler 2020-05-09 18:31:39 +02:00 committed by verdre
parent c8837a8de5
commit 4729cb779e

View File

@ -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 */