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.
This commit is contained in:
Emmanuele Bassi 2012-04-10 12:12:50 +01:00
parent 612b714149
commit b12514ff9a

View File

@ -897,6 +897,14 @@ clutter_stage_real_fullscreen (ClutterStage *stage)
box.x2 = geom.width; box.x2 = geom.width;
box.y2 = geom.height; 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), clutter_actor_allocate (CLUTTER_ACTOR (stage),
&box, &box,
CLUTTER_ALLOCATION_NONE); CLUTTER_ALLOCATION_NONE);