From b12514ff9a8424bf4c97c1b0c4f608cbe2c5817b Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 10 Apr 2012 12:12:50 +0100 Subject: [PATCH] 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 file changed, 8 insertions(+) diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index d2854eae8..7ea13b5c0 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);