diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2012-03-05 17:38:27 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2012-03-05 17:38:27 +0000 |
commit | 720fbd3bec522f200396f206242bc76285492f15 (patch) | |
tree | 412a7c3ae945f1fc0865e3f62cabacd018edcedf | |
parent | add274c447f1d4a2d9c269754c019882738662c1 (diff) | |
download | clutter-720fbd3bec522f200396f206242bc76285492f15.tar.gz |
stage: Fix up a copy-and-paste train wreck
The show and hide implementation inside ClutterStage ended up being
recursive, and the hide implementation would actually show the children
of the stage unconditionally.
Whoopsie.
-rw-r--r-- | clutter/clutter-stage.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index a9ab25a6b..123caeb09 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -790,16 +790,26 @@ clutter_stage_unrealize (ClutterActor *self) } static void -clutter_stage_show (ClutterActor *self) +clutter_stage_show_all (ClutterActor *self) { - ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; ClutterActorIter iter; ClutterActor *child; + /* we don't do a recursive show_all(), to maintain the old + * invariants from ClutterGroup + */ clutter_actor_iter_init (&iter, self); while (clutter_actor_iter_next (&iter, &child)) clutter_actor_show (child); + clutter_actor_show (self); +} + +static void +clutter_stage_show (ClutterActor *self) +{ + ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; + CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->show (self); /* Possibly do an allocation run so that the stage will have the @@ -811,18 +821,28 @@ clutter_stage_show (ClutterActor *self) } static void -clutter_stage_hide (ClutterActor *self) +clutter_stage_hide_all (ClutterActor *self) { - ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; ClutterActorIter iter; ClutterActor *child; - g_assert (priv->impl != NULL); - _clutter_stage_window_hide (priv->impl); + clutter_actor_hide (self); + /* we don't do a recursive hide_all(), to maintain the old invariants + * from ClutterGroup + */ clutter_actor_iter_init (&iter, self); while (clutter_actor_iter_next (&iter, &child)) - clutter_actor_show (child); + clutter_actor_hide (child); +} + +static void +clutter_stage_hide (ClutterActor *self) +{ + ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; + + g_assert (priv->impl != NULL); + _clutter_stage_window_hide (priv->impl); CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->hide (self); } @@ -1844,7 +1864,9 @@ clutter_stage_class_init (ClutterStageClass *klass) actor_class->realize = clutter_stage_realize; actor_class->unrealize = clutter_stage_unrealize; actor_class->show = clutter_stage_show; + actor_class->show_all = clutter_stage_show_all; actor_class->hide = clutter_stage_hide; + actor_class->hide_all = clutter_stage_hide_all; actor_class->queue_relayout = clutter_stage_real_queue_relayout; actor_class->queue_redraw = clutter_stage_real_queue_redraw; actor_class->apply_transform = clutter_stage_real_apply_transform; |