clutter_init_real (GError **error)
{
ClutterMainContext *ctx;
- ClutterActor *stage;
ClutterBackend *backend;
/* Note, creates backend if not already existing, though parse args will
/* 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;
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);
}