Set the SYNC_MATRICES flag when a stage is first realized
authorNeil Roberts <neil@linux.intel.com>
Wed, 21 Jan 2009 12:47:29 +0000 (12:47 +0000)
committerNeil Roberts <neil@linux.intel.com>
Mon, 26 Jan 2009 10:58:40 +0000 (10:58 +0000)
The stage will usually be painted before the first ConfigureNotify
arrives so we need to set the SYNC_MATRICES flag to ensure that the
viewport will be correct for that paint. Unfortunately this means that
the viewport will be set again once the ConfigureNotify is received
but compared to rendering an initial invalid scene I think it is the
lesser of two evils.

clutter/clutter-stage.c

index 07c5e49..3e38fe6 100644 (file)
@@ -258,6 +258,11 @@ clutter_stage_realize (ClutterActor *self)
 
   CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_REALIZED);
 
+  /* Make sure the viewport and projection matrix are valid for the
+     first paint (which will likely occur before the ConfigureNotify
+     is received) */
+  CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_SYNC_MATRICES);
+
   g_assert (priv->impl != NULL);
   CLUTTER_ACTOR_GET_CLASS (priv->impl)->realize (priv->impl);