From 1481836ed649b58de085e0a621bf6d19a7d728ab Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 6 Dec 2013 14:19:32 -0500 Subject: [PATCH] surface-actor: Move work out of _new constructor If we want to have any chance at creating subclasses of MetaSurfaceActor, we can't do work in the constructor... --- src/compositor/meta-surface-actor.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c index 540c7f49c..486e94eba 100644 --- a/src/compositor/meta-surface-actor.c +++ b/src/compositor/meta-surface-actor.c @@ -67,21 +67,8 @@ meta_surface_actor_init (MetaSurfaceActor *self) META_TYPE_SURFACE_ACTOR, MetaSurfaceActorPrivate); - priv->texture = NULL; -} - -MetaSurfaceActor * -meta_surface_actor_new (void) -{ - MetaSurfaceActor *self = g_object_new (META_TYPE_SURFACE_ACTOR, NULL); - MetaShapedTexture *stex; - - stex = META_SHAPED_TEXTURE (meta_shaped_texture_new ()); - self->priv->texture = stex; - - clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (stex)); - - return self; + priv->texture = META_SHAPED_TEXTURE (meta_shaped_texture_new ()); + clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->texture)); } cairo_surface_t * @@ -183,3 +170,9 @@ meta_surface_actor_set_opaque_region (MetaSurfaceActor *self, { meta_shaped_texture_set_opaque_region (self->priv->texture, region); } + +MetaSurfaceActor * +meta_surface_actor_new (void) +{ + return g_object_new (META_TYPE_SURFACE_ACTOR, NULL); +}