summaryrefslogtreecommitdiff
path: root/clutter/clutter-backend.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2011-11-09 14:04:05 +0000
committerEmmanuele Bassi <ebassi@linux.intel.com>2011-11-10 15:37:51 +0000
commit26f44673922bc3d0b854bdcb0c519f1a62bd433a (patch)
treef5a5e3f7c8022604b7d249aac06f38a442c77a69 /clutter/clutter-backend.c
parent5903fcc36db8ea3115471aaf04322a7cae7cdfc2 (diff)
downloadclutter-26f44673922bc3d0b854bdcb0c519f1a62bd433a.tar.gz
Try to mop up the default stage mess
The default stage was a neat concept when we started Clutter out, somewhere in the Jurassic era; a singleton instance that gets created at initialization time, and remains the same for the entire duration of the process. Worked well enough when Clutter was a small library meant to be used to write fullscreen media browsers, but since the introduction of multiple stages, and Clutter being used to create all sorts of applications, the default stage is just a vestigial remainder of that past, like an appendix; something that complicates the layout of the code and introduces weird behaviour, so that you notice its existence only when something goes wrong. Some platforms we do support, though, only have one framebuffer, so it makes sense for them to have only one stage. At this point, the only sane thing to do is to go through the same code paths on all platforms, and that code path is the stage instance creation and initialization — i.e. clutter_stage_new() (or g_object_new() with CLUTTER_TYPE_STAGE). For platforms that support multiple stages, nothing has changed: the stage created by clutter_stage_get_default() will be set as the default one; if nobody calls it, the default stage is never created, and it just lives on as a meaningless check. For platforms that only support one stage, clutter_stage_new() and clutter_stage_get_default() will behave exactly the same the first time they are called: both will create a stage, and set it as the default. Calling clutter_stage_new() a second time is treated as a programmer error, and will result in Clutter aborting. This is a behavioural change because the existing behaviour or creating a new ClutterStage instance with the same ClutterStageWindow private implementation is, simply put, utterly braindamaged and I should have *never* had written it, and I apologize for it. In my defence, I didn't know any better at the time. This is the first step towards the complete deprecation of clutter_stage_get_default() and clutter_stage_is_default(), which will come later.
Diffstat (limited to 'clutter/clutter-backend.c')
-rw-r--r--clutter/clutter-backend.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index fe9cba798..1851d1da0 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -684,14 +684,11 @@ _clutter_backend_create_stage (ClutterBackend *backend,
GError **error)
{
ClutterBackendClass *klass;
- ClutterStageManager *stage_manager;
ClutterStageWindow *stage_window;
g_assert (CLUTTER_IS_BACKEND (backend));
g_assert (CLUTTER_IS_STAGE (wrapper));
- stage_manager = clutter_stage_manager_get_default ();
-
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->create_stage != NULL)
stage_window = klass->create_stage (backend, wrapper, error);
@@ -702,8 +699,6 @@ _clutter_backend_create_stage (ClutterBackend *backend,
return NULL;
g_assert (CLUTTER_IS_STAGE_WINDOW (stage_window));
- _clutter_stage_set_window (wrapper, stage_window);
- _clutter_stage_manager_add_stage (stage_manager, wrapper);
return stage_window;
}