From 3e7b1d9cbd9c3d45c8c53f69ef9d6bbd0211e176 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Mon, 27 May 2024 14:20:08 +0200 Subject: [PATCH] wayland: Handle unmapping surfaces Right now the unmapped signal doesn't always fire which means we didn't see a surface that's being unmapped in these code paths before. In particular the resource, window and role can be gone. Handle those cases. Part-of: --- src/wayland/meta-wayland-popup.c | 2 +- src/wayland/meta-wayland-surface.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-wayland-popup.c b/src/wayland/meta-wayland-popup.c index ffb5b107c..edd0407bc 100644 --- a/src/wayland/meta-wayland-popup.c +++ b/src/wayland/meta-wayland-popup.c @@ -122,7 +122,7 @@ popup_grab_get_focus_surface (MetaWaylandEventHandler *handler, device, sequence); - if (surface && + if (surface && surface->resource && wl_resource_get_client (surface->resource) == popup_grab->grab_client) return surface; } diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index c9b921583..a6454641d 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -1501,7 +1501,7 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data) void meta_wayland_surface_update_outputs (MetaWaylandSurface *surface) { - if (!surface->compositor) + if (!surface->compositor || !surface->role) return; g_hash_table_foreach (surface->compositor->outputs,