[mutter] clutter/stage: Stop using DELEGATE_LAYOUT allocation flag
- From: verdre <jonasd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/stage: Stop using DELEGATE_LAYOUT allocation flag
- Date: Wed, 20 May 2020 13:17:33 +0000 (UTC)
commit 4729cb779e27153b1caf4be523b2bbd2f1104697
Author: Jonas Dreßler <verdre v0yd nl>
Date: Sat May 9 18:31:39 2020 +0200
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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]