From 23707f65040546d4594e458ab5068c0bccc31bd0 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Sat, 16 Jun 2018 17:29:26 +0300 Subject: [PATCH] layer-shell: check whether the surface is mapped in layer_surface_destroy() If the layer surface has been closed by the compositor, using layer_surface_close(), then the unmap event is emitted. However, when the layer surface is later destroyed by the client, the compositor used to get a second unmap, which is fixed with this commit. --- types/wlr_layer_shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index e64d7937..76d6d721 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -176,7 +176,9 @@ static void layer_surface_unmap(struct wlr_layer_surface *surface) { } static void layer_surface_destroy(struct wlr_layer_surface *surface) { - layer_surface_unmap(surface); + if (surface->configured && surface->mapped) { + layer_surface_unmap(surface); + } wlr_signal_emit_safe(&surface->events.destroy, surface); wl_resource_set_user_data(surface->resource, NULL); wl_list_remove(&surface->surface_destroy_listener.link);