stage: Do not create the default stage on stage.is_default()
authorEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 21 Jan 2011 11:43:00 +0000 (11:43 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 21 Jan 2011 11:43:00 +0000 (11:43 +0000)
Use the stage manager to see if a default stage was effectively set,
otherwise we end up creating a default stage when destroying a
non-default one.

clutter/clutter-stage.c

index 60d54a0..48935cb 100644 (file)
@@ -2783,18 +2783,20 @@ clutter_stage_queue_redraw (ClutterStage *stage)
 gboolean
 clutter_stage_is_default (ClutterStage *stage)
 {
+  ClutterStageManager *stage_manager;
   ClutterStageWindow *impl;
 
   g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
 
-  if (CLUTTER_ACTOR (stage) == clutter_stage_get_default ())
-    return TRUE;
+  stage_manager = clutter_stage_manager_get_default ();
+  if (stage != clutter_stage_manager_get_default_stage (stage_manager))
+    return FALSE;
 
   impl = _clutter_stage_get_window (stage);
-  if (impl == _clutter_stage_get_default_window ())
-    return TRUE;
+  if (impl != _clutter_stage_get_default_window ())
+    return FALSE;
 
-  return FALSE;
+  return TRUE;
 }
 
 void