summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2013-07-03 14:39:33 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2013-07-03 14:39:33 +0100
commit7990db472a03fbefb8673d018f297cf5a89ef769 (patch)
tree7544df91cb0d3a7faf4686c9cdb06aad849fb531
parent0ef8b581bac4c3eb1c8cc2dc4d93fb605d96e8cd (diff)
downloadclutter-gtk-7990db472a03fbefb8673d018f297cf5a89ef769.tar.gz
actor: Update after the API change in Clutter
The unstable ClutterCanvas API was changed, so we need to update GtkClutterActor to use it.
-rw-r--r--clutter-gtk/gtk-clutter-actor.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/clutter-gtk/gtk-clutter-actor.c b/clutter-gtk/gtk-clutter-actor.c
index d1e7c64..b5de571 100644
--- a/clutter-gtk/gtk-clutter-actor.c
+++ b/clutter-gtk/gtk-clutter-actor.c
@@ -195,35 +195,20 @@ gtk_clutter_actor_realize (ClutterActor *actor)
{
int width = gtk_widget_get_allocated_width (priv->widget);
int height = gtk_widget_get_allocated_height (priv->widget);
- int canvas_width = 0, canvas_height = 0;
DEBUG (G_STRLOC ": Using image surface.\n");
- g_object_get (priv->canvas,
- "width", &canvas_width,
- "height", &canvas_height,
- NULL);
-
-
clutter_actor_set_size (priv->texture, width, height);
/* clutter_canvas_set_size() will invalidate its contents only
* if the size differs, but we want to invalidate the contents
- * in any case; we cannot call clutter_content_invalidate(),
- * though, because that may cause two invalidations in a row,
- * so we check the size of the canvas first.
+ * in any case; we cannot call clutter_content_invalidate()
+ * unconditionally, though, because that may cause two
+ * invalidations in a row, so we check the size of the canvas
+ * first.
*/
- if (width != canvas_width ||
- height != canvas_height)
- {
- clutter_canvas_set_size (CLUTTER_CANVAS (priv->canvas),
- width,
- height);
- }
- else
- {
- clutter_content_invalidate (priv->canvas);
- }
+ if (!clutter_canvas_set_size (CLUTTER_CANVAS (priv->canvas), width, height))
+ clutter_content_invalidate (priv->canvas);
}
}