summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-06-14 12:38:27 +0200
committerCarlos Garnacho <carlosg@gnome.org>2018-06-14 14:05:10 +0200
commit3649795108f692327845753cf553029697aefbde (patch)
treee9188be5255856c541844906429fa86d667d9304
parent36b9551f92f44c15415afcb98d7bf11b804f4465 (diff)
downloadmutter-3649795108f692327845753cf553029697aefbde.tar.gz
wayland: Detach MetaWaylandActorSurface from its actor on dispose
And ensure the actor is no longer reactive even though it might live longer because of close effects, GCs, and whatnot. This ensures the actor is not eligible for pointer picking within the destruction of its surface. Closes: #188
-rw-r--r--src/wayland/meta-wayland-actor-surface.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
index c0dc0c62b..ffa7b31e9 100644
--- a/src/wayland/meta-wayland-actor-surface.c
+++ b/src/wayland/meta-wayland-actor-surface.c
@@ -50,19 +50,23 @@ meta_wayland_actor_surface_constructed (GObject *object)
}
static void
-meta_wayland_actor_surface_finalize (GObject *object)
+meta_wayland_actor_surface_dispose (GObject *object)
{
MetaWaylandActorSurfacePrivate *priv =
meta_wayland_actor_surface_get_instance_private (META_WAYLAND_ACTOR_SURFACE (object));
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (object));
- g_signal_handlers_disconnect_by_func (priv->actor,
- meta_wayland_surface_notify_geometry_changed,
- surface);
- g_object_unref (priv->actor);
+ 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);
+ }
- G_OBJECT_CLASS (meta_wayland_actor_surface_parent_class)->finalize (object);
+ G_OBJECT_CLASS (meta_wayland_actor_surface_parent_class)->dispose (object);
}
static void
@@ -270,7 +274,7 @@ meta_wayland_actor_surface_class_init (MetaWaylandActorSurfaceClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = meta_wayland_actor_surface_constructed;
- object_class->finalize = meta_wayland_actor_surface_finalize;
+ object_class->dispose = meta_wayland_actor_surface_dispose;
surface_role_class->assigned = meta_wayland_actor_surface_assigned;
surface_role_class->commit = meta_wayland_actor_surface_commit;