[backend] Do not store the stage manager singleton

The StageManager singleton instance is already kept around
by the clutter_stage_manager_get_default() function; there is
no need to have it inside the main Clutter context as well.
This commit is contained in:
Emmanuele Bassi 2009-06-19 14:19:39 +01:00
parent b6e404a406
commit a6b4697367
3 changed files with 4 additions and 11 deletions

View File

@ -263,17 +263,14 @@ _clutter_backend_create_stage (ClutterBackend *backend,
ClutterStage *wrapper, ClutterStage *wrapper,
GError **error) GError **error)
{ {
ClutterMainContext *context;
ClutterBackendClass *klass; ClutterBackendClass *klass;
ClutterStageManager *stage_manager;
ClutterActor *stage = NULL; ClutterActor *stage = NULL;
g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), FALSE); g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), FALSE);
g_return_val_if_fail (CLUTTER_IS_STAGE (wrapper), FALSE); g_return_val_if_fail (CLUTTER_IS_STAGE (wrapper), FALSE);
context = _clutter_context_get_default (); stage_manager = clutter_stage_manager_get_default ();
if (!context->stage_manager)
context->stage_manager = clutter_stage_manager_get_default ();
klass = CLUTTER_BACKEND_GET_CLASS (backend); klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->create_stage) if (klass->create_stage)
@ -284,7 +281,7 @@ _clutter_backend_create_stage (ClutterBackend *backend,
g_assert (CLUTTER_IS_STAGE_WINDOW (stage)); g_assert (CLUTTER_IS_STAGE_WINDOW (stage));
_clutter_stage_set_window (wrapper, CLUTTER_STAGE_WINDOW (stage)); _clutter_stage_set_window (wrapper, CLUTTER_STAGE_WINDOW (stage));
_clutter_stage_manager_add_stage (context->stage_manager, wrapper); _clutter_stage_manager_add_stage (stage_manager, wrapper);
return stage; return stage;
} }

View File

@ -89,7 +89,6 @@ struct _ClutterMainContext
{ {
ClutterBackend *backend; /* holds a pointer to the windowing ClutterBackend *backend; /* holds a pointer to the windowing
system backend */ system backend */
ClutterStageManager *stage_manager; /* stages */
GQueue *events_queue; /* the main event queue */ GQueue *events_queue; /* the main event queue */
guint is_initialized : 1; guint is_initialized : 1;

View File

@ -284,13 +284,10 @@ static void
clutter_backend_x11_dispose (GObject *gobject) clutter_backend_x11_dispose (GObject *gobject)
{ {
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (gobject); ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (gobject);
ClutterMainContext *context;
ClutterStageManager *stage_manager; ClutterStageManager *stage_manager;
CLUTTER_NOTE (BACKEND, "Disposing the of stages"); CLUTTER_NOTE (BACKEND, "Disposing the of stages");
stage_manager = clutter_stage_manager_get_default ();
context = _clutter_context_get_default ();
stage_manager = context->stage_manager;
/* Destroy all of the stages. g_slist_foreach is used because the /* Destroy all of the stages. g_slist_foreach is used because the
finalizer for the stages will remove the stage from the finalizer for the stages will remove the stage from the