[clutter/clutter-1.10] stage: Unset the natural size when fullscreening



commit bda3f00d423a15c345bf3981f305fd82be7233dd
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Apr 10 12:12:50 2012 +0100

    stage: Unset the natural size when fullscreening
    
    This ensures that constraints and signal handlers will go through the
    allocation and not through the cache after ::fullscreen has been
    emitted.

 clutter/clutter-stage.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index 123caeb..fd4a8ef 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -897,6 +897,14 @@ clutter_stage_real_fullscreen (ClutterStage *stage)
   box.x2 = geom.width;
   box.y2 = geom.height;
 
+  /* we need to blow the caching on the Stage size, given that
+   * we're about to force an allocation, because if anything
+   * ends up querying the size of the stage during the allocate()
+   * call, like constraints or signal handlers, we'll get into an
+   * inconsistent state: the stage will report the old cached size,
+   * but the allocation will be updated anyway.
+   */
+  clutter_actor_set_size (CLUTTER_ACTOR (stage), -1.0, -1.0);
   clutter_actor_allocate (CLUTTER_ACTOR (stage),
                           &box,
                           CLUTTER_ALLOCATION_NONE);



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