From 4729cb779e27153b1caf4be523b2bbd2f1104697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sat, 9 May 2020 18:31:39 +0200 Subject: [PATCH] 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 --- clutter/clutter/clutter-stage.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index d656ec2e9..487af060a 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -622,6 +622,7 @@ clutter_stage_allocate (ClutterActor *self, float new_width, new_height; float width, height; cairo_rectangle_int_t window_size; + ClutterLayoutManager *layout_manager = clutter_actor_get_layout_manager (self); if (priv->impl == NULL) return; @@ -643,6 +644,12 @@ clutter_stage_allocate (ClutterActor *self, */ 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, "Following allocation to %.2fx%.2f (absolute origin %s)", width, height, @@ -650,8 +657,12 @@ clutter_stage_allocate (ClutterActor *self, ? "changed" : "not changed"); - clutter_actor_set_allocation (self, box, - flags | CLUTTER_DELEGATE_LAYOUT); + clutter_actor_set_allocation (self, box, flags); + + clutter_layout_manager_allocate (layout_manager, + CLUTTER_CONTAINER (self), + &children_box, + flags); /* Ensure the window is sized correctly */ if (priv->min_size_changed) @@ -707,8 +718,12 @@ clutter_stage_allocate (ClutterActor *self, : "not changed"); /* and store the overridden allocation */ - clutter_actor_set_allocation (self, &override, - flags | CLUTTER_DELEGATE_LAYOUT); + clutter_actor_set_allocation (self, &override, flags); + + clutter_layout_manager_allocate (layout_manager, + CLUTTER_CONTAINER (self), + &override, + flags); } /* reset the viewport if the allocation effectively changed */