[mutter/wayland] surface-actor: Move work out of _new constructor
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wayland] surface-actor: Move work out of _new constructor
- Date: Sat, 7 Dec 2013 01:12:42 +0000 (UTC)
commit 1481836ed649b58de085e0a621bf6d19a7d728ab
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Dec 6 14:19:32 2013 -0500
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 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 540c7f4..486e94e 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);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]