From eb9cd3857df22b0e583dd9c5bf21762458921aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sat, 6 Jun 2020 13:00:16 +0200 Subject: [PATCH] clutter/actor: Set initial allocation to uninitialized ClutterActorBox We currently initialize the ClutterActorBox of the actors allocation to zero, but there's a difference between a valid zero-allocation and an actor having never been allocated. Currently it's impossible for us to detect the latter case in a reliable way and we use the needs_allocation flag for this, which may also be set in other situations. So initialize the allocation of actors to the newly added UNINITIALIZED ClutterActorBox, which will make it easier to detect whether an actor already got its initial allocation. This also fixes another issue right now: Actors which get allocated a (valid) zero allocation, will now notify the "allocation" property in this case. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1290 --- clutter/clutter/clutter-actor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 1195316f8..1ebc6dde0 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -8694,6 +8694,8 @@ clutter_actor_init (ClutterActor *self) self->priv = priv = clutter_actor_get_instance_private (self); + priv->allocation = (ClutterActorBox) CLUTTER_ACTOR_BOX_UNINITIALIZED; + priv->opacity = 0xff; priv->show_on_set_parent = TRUE; priv->resource_scale = -1.0f;