wayland/surface: Send unmapped signal when the surface goes away
This was the intention anwyway but it didn't work properly because
GObject::dispose removes all signal handlers and we unmap surfaces in
WaylandShellSurface::finalize. Move all the unmanaging and unmapping to
the dispose vfunc where we can still run all the signal handlers.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3501
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3783>
(cherry picked from commit 4eacf97678
)
This commit is contained in:
parent
e8cc52044d
commit
7e4f6faaaa
2 changed files with 19 additions and 12 deletions
|
@ -314,13 +314,13 @@ meta_wayland_shell_surface_destroy_window (MetaWaylandShellSurface *shell_surfac
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_wayland_shell_surface_finalize (GObject *object)
|
meta_wayland_shell_surface_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
MetaWaylandShellSurface *shell_surface = META_WAYLAND_SHELL_SURFACE (object);
|
MetaWaylandShellSurface *shell_surface = META_WAYLAND_SHELL_SURFACE (object);
|
||||||
|
|
||||||
meta_wayland_shell_surface_destroy_window (shell_surface);
|
meta_wayland_shell_surface_destroy_window (shell_surface);
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_wayland_shell_surface_parent_class)->finalize (object);
|
G_OBJECT_CLASS (meta_wayland_shell_surface_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -337,7 +337,7 @@ meta_wayland_shell_surface_class_init (MetaWaylandShellSurfaceClass *klass)
|
||||||
MetaWaylandActorSurfaceClass *actor_surface_class =
|
MetaWaylandActorSurfaceClass *actor_surface_class =
|
||||||
META_WAYLAND_ACTOR_SURFACE_CLASS (klass);
|
META_WAYLAND_ACTOR_SURFACE_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = meta_wayland_shell_surface_finalize;
|
object_class->dispose = meta_wayland_shell_surface_dispose;
|
||||||
|
|
||||||
surface_role_class->assigned = meta_wayland_shell_surface_assigned;
|
surface_role_class->assigned = meta_wayland_shell_surface_assigned;
|
||||||
surface_role_class->pre_apply_state =
|
surface_role_class->pre_apply_state =
|
||||||
|
|
|
@ -1516,7 +1516,7 @@ meta_wayland_surface_notify_unmapped (MetaWaylandSurface *surface)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_wayland_surface_finalize (GObject *object)
|
meta_wayland_surface_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
MetaWaylandSurface *surface = META_WAYLAND_SURFACE (object);
|
MetaWaylandSurface *surface = META_WAYLAND_SURFACE (object);
|
||||||
MetaWaylandCompositor *compositor = surface->compositor;
|
MetaWaylandCompositor *compositor = surface->compositor;
|
||||||
|
@ -1533,7 +1533,11 @@ meta_wayland_surface_finalize (GObject *object)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surface->buffer_held)
|
if (surface->buffer_held)
|
||||||
|
{
|
||||||
meta_wayland_buffer_dec_use_count (surface->buffer);
|
meta_wayland_buffer_dec_use_count (surface->buffer);
|
||||||
|
surface->buffer_held = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
g_clear_object (&surface->applied_state.texture);
|
g_clear_object (&surface->applied_state.texture);
|
||||||
g_clear_object (&surface->buffer);
|
g_clear_object (&surface->buffer);
|
||||||
|
|
||||||
|
@ -1544,10 +1548,13 @@ meta_wayland_surface_finalize (GObject *object)
|
||||||
meta_wayland_compositor_remove_presentation_feedback_surface (compositor,
|
meta_wayland_compositor_remove_presentation_feedback_surface (compositor,
|
||||||
surface);
|
surface);
|
||||||
|
|
||||||
|
if (surface->outputs)
|
||||||
|
{
|
||||||
g_hash_table_foreach (surface->outputs,
|
g_hash_table_foreach (surface->outputs,
|
||||||
surface_output_disconnect_signals,
|
surface_output_disconnect_signals,
|
||||||
surface);
|
surface);
|
||||||
g_hash_table_destroy (surface->outputs);
|
}
|
||||||
|
g_clear_pointer (&surface->outputs, g_hash_table_destroy);
|
||||||
|
|
||||||
wl_list_for_each_safe (cb, next,
|
wl_list_for_each_safe (cb, next,
|
||||||
&surface->unassigned.pending_frame_callback_list,
|
&surface->unassigned.pending_frame_callback_list,
|
||||||
|
@ -1562,9 +1569,9 @@ meta_wayland_surface_finalize (GObject *object)
|
||||||
|
|
||||||
g_clear_pointer (&surface->applied_state.subsurface_branch_node, g_node_destroy);
|
g_clear_pointer (&surface->applied_state.subsurface_branch_node, g_node_destroy);
|
||||||
|
|
||||||
g_hash_table_destroy (surface->shortcut_inhibited_seats);
|
g_clear_pointer (&surface->shortcut_inhibited_seats, g_hash_table_destroy);
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_wayland_surface_parent_class)->finalize (object);
|
G_OBJECT_CLASS (meta_wayland_surface_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1866,7 +1873,7 @@ meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = meta_wayland_surface_finalize;
|
object_class->dispose = meta_wayland_surface_dispose;
|
||||||
object_class->get_property = meta_wayland_surface_get_property;
|
object_class->get_property = meta_wayland_surface_get_property;
|
||||||
|
|
||||||
obj_props[PROP_SCANOUT_CANDIDATE] =
|
obj_props[PROP_SCANOUT_CANDIDATE] =
|
||||||
|
|
Loading…
Reference in a new issue