MetaWaylandSurface: Move destroy signal even earlier
Move the MetaWaylandSurface::destroy signal before starting the actual destruction, in wl_surface_destructor, so that all fields (e.g. surface role) are intact when the listeners are invoked. https://bugzilla.gnome.org/show_bug.cgi?id=771050
This commit is contained in:
parent
3a41b0f221
commit
fccdd00f74
@ -1216,6 +1216,8 @@ wl_surface_destructor (struct wl_resource *resource)
|
|||||||
MetaWaylandCompositor *compositor = surface->compositor;
|
MetaWaylandCompositor *compositor = surface->compositor;
|
||||||
MetaWaylandFrameCallback *cb, *next;
|
MetaWaylandFrameCallback *cb, *next;
|
||||||
|
|
||||||
|
g_signal_emit (surface, surface_signals[SURFACE_DESTROY], 0);
|
||||||
|
|
||||||
g_clear_object (&surface->role);
|
g_clear_object (&surface->role);
|
||||||
|
|
||||||
/* If we still have a window at the time of destruction, that means that
|
/* 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;
|
*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
|
static void
|
||||||
meta_wayland_surface_init (MetaWaylandSurface *surface)
|
meta_wayland_surface_init (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
@ -1783,8 +1771,6 @@ meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->dispose = meta_wayland_surface_dispose;
|
|
||||||
|
|
||||||
surface_signals[SURFACE_DESTROY] =
|
surface_signals[SURFACE_DESTROY] =
|
||||||
g_signal_new ("destroy",
|
g_signal_new ("destroy",
|
||||||
G_TYPE_FROM_CLASS (object_class),
|
G_TYPE_FROM_CLASS (object_class),
|
||||||
|
@ -184,7 +184,6 @@ struct _MetaWaylandSurface
|
|||||||
int32_t offset_x, offset_y;
|
int32_t offset_x, offset_y;
|
||||||
GList *subsurfaces;
|
GList *subsurfaces;
|
||||||
GHashTable *outputs_to_destroy_notify_id;
|
GHashTable *outputs_to_destroy_notify_id;
|
||||||
gboolean destroying;
|
|
||||||
|
|
||||||
/* Buffer reference state. */
|
/* Buffer reference state. */
|
||||||
struct {
|
struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user