Commit 092b3edb authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Georges Basile Stavracas Neto

wayland/actor-surface: Add actor clear helper

No functional changes.

!825
parent 8d6d2d07
......@@ -51,20 +51,32 @@ meta_wayland_actor_surface_constructed (GObject *object)
}
static void
meta_wayland_actor_surface_dispose (GObject *object)
clear_surface_actor (MetaWaylandActorSurface *actor_surface)
{
MetaWaylandActorSurfacePrivate *priv =
meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (object));
meta_wayland_actor_surface_get_instance_private (actor_surface);
MetaWaylandSurfaceRole *surface_role =
META_WAYLAND_SURFACE_ROLE (actor_surface);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (object));
meta_wayland_surface_role_get_surface (surface_role);
g_signal_handlers_disconnect_by_func (priv->actor,
meta_wayland_surface_notify_geometry_changed,
surface);
g_clear_object (&priv->actor);
}
static void
meta_wayland_actor_surface_dispose (GObject *object)
{
MetaWaylandActorSurface *actor_surface = META_WAYLAND_ACTOR_SURFACE (object);
MetaWaylandActorSurfacePrivate *priv =
meta_wayland_actor_surface_get_instance_private (actor_surface);
if (priv->actor)
{
g_signal_handlers_disconnect_by_func (priv->actor,
meta_wayland_surface_notify_geometry_changed,
surface);
clutter_actor_set_reactive (CLUTTER_ACTOR (priv->actor), FALSE);
g_clear_object (&priv->actor);
clear_surface_actor (actor_surface);
}
G_OBJECT_CLASS (meta_wayland_actor_surface_parent_class)->dispose (object);
......@@ -300,13 +312,7 @@ meta_wayland_actor_surface_reset_actor (MetaWaylandActorSurface *actor_surface)
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (actor_surface));
if (priv->actor)
{
g_signal_handlers_disconnect_by_func (priv->actor,
meta_wayland_surface_notify_geometry_changed,
surface);
g_object_unref (priv->actor);
}
clear_surface_actor (actor_surface);
priv->actor = g_object_ref_sink (meta_surface_actor_wayland_new (surface));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment