diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index bfddef7e0..99e3dfd9e 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -1216,6 +1216,8 @@ wl_surface_destructor (struct wl_resource *resource) MetaWaylandCompositor *compositor = surface->compositor; MetaWaylandFrameCallback *cb, *next; + g_signal_emit (surface, surface_signals[SURFACE_DESTROY], 0); + g_clear_object (&surface->role); /* If we still have a window at the time of destruction, that means that @@ -1758,20 +1760,6 @@ meta_wayland_surface_get_absolute_coordinates (MetaWaylandSurface *surface, *y = v.y; } -static void -meta_wayland_surface_dispose (GObject *object) -{ - MetaWaylandSurface *surface = META_WAYLAND_SURFACE (object); - - if (!surface->destroying) - { - g_signal_emit (object, surface_signals[SURFACE_DESTROY], 0); - surface->destroying = TRUE; - } - - G_OBJECT_CLASS (meta_wayland_surface_parent_class)->dispose (object); -} - static void meta_wayland_surface_init (MetaWaylandSurface *surface) { @@ -1783,8 +1771,6 @@ meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->dispose = meta_wayland_surface_dispose; - surface_signals[SURFACE_DESTROY] = g_signal_new ("destroy", G_TYPE_FROM_CLASS (object_class), diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 1682fb657..bac94c396 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -184,7 +184,6 @@ struct _MetaWaylandSurface int32_t offset_x, offset_y; GList *subsurfaces; GHashTable *outputs_to_destroy_notify_id; - gboolean destroying; /* Buffer reference state. */ struct {