It's reasonably normal for a relayout of the stage to cause the stage
to be queued for drawing; for this reason we should do the relayout before
we clear stage->update_idle. (But want to clear update_idle() before actually
doing the redraw to handle the corner case where the draw queues another
redraw.)
ClutterStage *stage = user_data;
ClutterStagePrivate *priv = stage->priv;
+ /* clutter_redraw() will also call maybe_relayout(), but since a relayout can
+ * queue a redraw, we want to do the relayout before we clear the update_idle
+ * to avoid painting the stage twice. Calling maybe_relayout() twice in a row
+ * is cheap because of caching of requested and allocated size.
+ */
+ _clutter_stage_maybe_relayout (CLUTTER_ACTOR (stage));
+
if (priv->update_idle)
{
g_source_remove (priv->update_idle);