mirror of
https://github.com/brl/mutter.git
synced 2024-11-30 03:50:47 -05:00
stage: Only clutter_stage_get_default() creates the default stage
The introduction of the StageManager in 0.8 implied that the first Stage instance to be created was automatically assigned the status of "default stage". This was all well and good, since the default stage was created behind the curtains by the initialization sequence. Now that the initialization sequence does not create a default stage any longer, it means that the first stage created using clutter_stage_new() gets to be the default, and all special and warm and fuzzy - which also means that the first stage created by clutter_stage_new() cannot be destroyed or handled as any other stage. Whoopsie. Let's go back to the old semantics: the stage created by the first invocation of clutter_stage_get_default() is the default stage, and nothing else can be set as default. One day we'll be able to break the API and the whole default stage business will be a thing of the past.
This commit is contained in:
parent
9a6de8757f
commit
ee33357fd5
@ -216,10 +216,12 @@ void _clutter_input_device_set_actor (ClutterInputDevice *device,
|
|||||||
ClutterActor *_clutter_input_device_update (ClutterInputDevice *device);
|
ClutterActor *_clutter_input_device_update (ClutterInputDevice *device);
|
||||||
|
|
||||||
/* stage manager */
|
/* stage manager */
|
||||||
void _clutter_stage_manager_add_stage (ClutterStageManager *stage_manager,
|
void _clutter_stage_manager_add_stage (ClutterStageManager *stage_manager,
|
||||||
ClutterStage *stage);
|
ClutterStage *stage);
|
||||||
void _clutter_stage_manager_remove_stage (ClutterStageManager *stage_manager,
|
void _clutter_stage_manager_remove_stage (ClutterStageManager *stage_manager,
|
||||||
ClutterStage *stage);
|
ClutterStage *stage);
|
||||||
|
void _clutter_stage_manager_set_default_stage (ClutterStageManager *stage_manager,
|
||||||
|
ClutterStage *stage);
|
||||||
|
|
||||||
/* stage */
|
/* stage */
|
||||||
void _clutter_stage_set_window (ClutterStage *stage,
|
void _clutter_stage_set_window (ClutterStage *stage,
|
||||||
|
@ -212,6 +212,31 @@ clutter_stage_manager_set_default_stage (ClutterStageManager *stage_manager,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* _clutter_stage_manager_set_default_stage:
|
||||||
|
* @stage_manager: a #ClutterStageManager
|
||||||
|
* @stage: a #ClutterStage
|
||||||
|
*
|
||||||
|
* Sets @stage as the default stage
|
||||||
|
*
|
||||||
|
* A no-op if there already is a default stage
|
||||||
|
*
|
||||||
|
* This is called by clutter_stage_get_default() and should be removed
|
||||||
|
* along with #ClutterStageManager:default-stage when we stop having
|
||||||
|
* the default stage
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_clutter_stage_manager_set_default_stage (ClutterStageManager *stage_manager,
|
||||||
|
ClutterStage *stage)
|
||||||
|
{
|
||||||
|
if (G_UNLIKELY (default_stage == NULL))
|
||||||
|
{
|
||||||
|
default_stage = stage;
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (stage_manager), "default-stage");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_stage_manager_get_default_stage:
|
* clutter_stage_manager_get_default_stage:
|
||||||
* @stage_manager: a #ClutterStageManager
|
* @stage_manager: a #ClutterStageManager
|
||||||
@ -281,13 +306,6 @@ _clutter_stage_manager_add_stage (ClutterStageManager *stage_manager,
|
|||||||
|
|
||||||
stage_manager->stages = g_slist_append (stage_manager->stages, stage);
|
stage_manager->stages = g_slist_append (stage_manager->stages, stage);
|
||||||
|
|
||||||
if (G_UNLIKELY (default_stage == NULL))
|
|
||||||
{
|
|
||||||
default_stage = stage;
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (stage_manager), "default-stage");
|
|
||||||
}
|
|
||||||
|
|
||||||
g_signal_emit (stage_manager, manager_signals[STAGE_ADDED], 0, stage);
|
g_signal_emit (stage_manager, manager_signals[STAGE_ADDED], 0, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1217,6 +1217,7 @@ clutter_stage_get_default (void)
|
|||||||
* reference will be claimed by the stage manager.
|
* reference will be claimed by the stage manager.
|
||||||
*/
|
*/
|
||||||
stage = g_object_new (CLUTTER_TYPE_STAGE, NULL);
|
stage = g_object_new (CLUTTER_TYPE_STAGE, NULL);
|
||||||
|
_clutter_stage_manager_set_default_stage (stage_manager, stage);
|
||||||
|
|
||||||
/* the default stage is realized by default */
|
/* the default stage is realized by default */
|
||||||
clutter_actor_realize (CLUTTER_ACTOR (stage));
|
clutter_actor_realize (CLUTTER_ACTOR (stage));
|
||||||
|
Loading…
Reference in New Issue
Block a user