From 7df11ada5e454e71bc85053912515cb19ed3f1fe Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Wed, 26 Jul 2023 23:07:28 +0300 Subject: [PATCH] Unmap wlr_surface before making its role object inert --- types/wlr_input_method_v2.c | 2 ++ types/wlr_layer_shell_v1.c | 2 ++ types/wlr_session_lock_v1.c | 2 ++ types/wlr_subcompositor.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/types/wlr_input_method_v2.c b/types/wlr_input_method_v2.c index 387cba4b..0559b216 100644 --- a/types/wlr_input_method_v2.c +++ b/types/wlr_input_method_v2.c @@ -20,6 +20,8 @@ static const struct zwp_input_method_v2_interface input_method_impl; static const struct zwp_input_method_keyboard_grab_v2_interface keyboard_grab_impl; static void popup_surface_destroy(struct wlr_input_popup_surface_v2 *popup_surface) { + wlr_surface_unmap(popup_surface->surface); + wl_signal_emit_mutable(&popup_surface->events.destroy, NULL); wl_list_remove(&popup_surface->link); wl_resource_set_user_data(popup_surface->resource, NULL); diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c index 82947087..c128bf85 100644 --- a/types/wlr_layer_shell_v1.c +++ b/types/wlr_layer_shell_v1.c @@ -23,6 +23,8 @@ static const struct zwlr_layer_shell_v1_interface layer_shell_implementation; static const struct zwlr_layer_surface_v1_interface layer_surface_implementation; static void layer_surface_destroy(struct wlr_layer_surface_v1 *surface) { + wlr_surface_unmap(surface->surface); + wl_signal_emit_mutable(&surface->events.destroy, surface); wl_resource_set_user_data(surface->resource, NULL); free(surface->namespace); diff --git a/types/wlr_session_lock_v1.c b/types/wlr_session_lock_v1.c index 4b8a69ad..6f574eaf 100644 --- a/types/wlr_session_lock_v1.c +++ b/types/wlr_session_lock_v1.c @@ -23,6 +23,8 @@ static const struct ext_session_lock_v1_interface lock_implementation; static const struct ext_session_lock_surface_v1_interface lock_surface_implementation; static void lock_surface_destroy(struct wlr_session_lock_surface_v1 *lock_surface) { + wlr_surface_unmap(lock_surface->surface); + wl_signal_emit_mutable(&lock_surface->events.destroy, NULL); wl_list_remove(&lock_surface->link); diff --git a/types/wlr_subcompositor.c b/types/wlr_subcompositor.c index 95ddb8ca..e2ed9f3b 100644 --- a/types/wlr_subcompositor.c +++ b/types/wlr_subcompositor.c @@ -29,6 +29,8 @@ static void subsurface_destroy(struct wlr_subsurface *subsurface) { wlr_surface_unlock_cached(subsurface->surface, subsurface->cached_seq); } + wlr_surface_unmap(subsurface->surface); + wl_signal_emit_mutable(&subsurface->events.destroy, subsurface); wl_list_remove(&subsurface->surface_client_commit.link);