summaryrefslogtreecommitdiff
path: root/clutter-gtk/gtk-clutter-embed.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2010-07-21 11:54:58 +0100
committerEmmanuele Bassi <ebassi@linux.intel.com>2010-07-21 11:54:58 +0100
commit7a9a1593c5140c8299715971b5f032276790af8e (patch)
tree1c46bad5b973331d6d6ca44bb84beea141d52fcc /clutter-gtk/gtk-clutter-embed.c
parentb199dd088c2560844e8745ce5adcdfabc01a3d06 (diff)
downloadclutter-gtk-7a9a1593c5140c8299715971b5f032276790af8e.tar.gz
embed: Ensure the viewport only if we're realized
There's no point in doing that if the ClutterStage doesn't have a foreign window set.
Diffstat (limited to 'clutter-gtk/gtk-clutter-embed.c')
-rw-r--r--clutter-gtk/gtk-clutter-embed.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c
index 7538d5c..6d457b5 100644
--- a/clutter-gtk/gtk-clutter-embed.c
+++ b/clutter-gtk/gtk-clutter-embed.c
@@ -320,20 +320,23 @@ gtk_clutter_embed_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
+ /* change the size of the stage and ensure that the viewport
+ * has been updated as well
+ */
+ clutter_actor_set_size (priv->stage, allocation->width, allocation->height);
+
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (gtk_widget_get_window (widget),
- allocation->x, allocation->y,
- allocation->width, allocation->height);
+ allocation->x,
+ allocation->y,
+ allocation->width,
+ allocation->height);
+
+ clutter_stage_ensure_viewport (CLUTTER_STAGE (priv->stage));
gtk_clutter_embed_send_configure (GTK_CLUTTER_EMBED (widget));
}
-
- /* change the size of the stage and ensure that the viewport
- * has been updated as well
- */
- clutter_actor_set_size (priv->stage, allocation->width, allocation->height);
- clutter_stage_ensure_viewport (CLUTTER_STAGE (priv->stage));
}
static gboolean
@@ -349,7 +352,7 @@ gtk_clutter_embed_expose_event (GtkWidget *widget,
}
/* force a redraw on expose */
- clutter_redraw (CLUTTER_STAGE (priv->stage));
+ clutter_stage_ensure_redraw (CLUTTER_STAGE (priv->stage));
return FALSE;
}