[mutter] clutter/actor: Set initial allocation to uninitialized ClutterActorBox



commit eb9cd3857df22b0e583dd9c5bf21762458921aa8
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sat Jun 6 13:00:16 2020 +0200

    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 1195316f8c..1ebc6dde00 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]