diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 3a74a0751..6347031ae 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -1492,7 +1492,6 @@ static ClutterInitError clutter_init_real (GError **error) { ClutterMainContext *ctx; - ClutterActor *stage; ClutterBackend *backend; /* Note, creates backend if not already existing, though parse args will @@ -1558,33 +1557,6 @@ clutter_init_real (GError **error) /* Initiate event collection */ _clutter_backend_init_events (ctx->backend); - /* Create the default stage and realize it */ - stage = clutter_stage_get_default (); - if (!stage) - { - if (error) - g_set_error (error, CLUTTER_INIT_ERROR, - CLUTTER_INIT_ERROR_INTERNAL, - "Unable to create the default stage"); - else - g_critical ("Unable to create the default stage"); - - return CLUTTER_INIT_ERROR_INTERNAL; - } - - clutter_actor_realize (stage); - if (!CLUTTER_ACTOR_IS_REALIZED (stage)) - { - if (error) - g_set_error (error, CLUTTER_INIT_ERROR, - CLUTTER_INIT_ERROR_INTERNAL, - "Unable to realize the default stage"); - else - g_critical ("Unable to realize the default stage"); - - return CLUTTER_INIT_ERROR_INTERNAL; - } - clutter_is_initialized = TRUE; ctx->is_initialized = TRUE; diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index b164e50c8..c67056d3d 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -1215,11 +1215,16 @@ clutter_stage_get_default (void) stage = clutter_stage_manager_get_default_stage (stage_manager); if (G_UNLIKELY (stage == NULL)) - /* This will take care of automatically adding the stage to the - * stage manager and setting it as the default. Its floating - * reference will be claimed by the stage manager. - */ - stage = g_object_new (CLUTTER_TYPE_STAGE, NULL); + { + /* This will take care of automatically adding the stage to the + * stage manager and setting it as the default. Its floating + * reference will be claimed by the stage manager. + */ + stage = g_object_new (CLUTTER_TYPE_STAGE, NULL); + + /* the default stage is realized by default */ + clutter_actor_realize (CLUTTER_ACTOR (stage)); + } return CLUTTER_ACTOR (stage); }