From 1cfc1aa92bfaa7e7b160c4b5c7f30cd7fe48e054 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 13 Mar 2024 18:08:10 +0100 Subject: [PATCH] wayland: Check surface before looking up modals Near window destruction, there might be cases where the surface actor does no longer have a surface, yet it's still in the stage and eligible for picking. In that situation looking for modal dialogs attached to this surface will evidently fail, so avoid this check on a NULL surface. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3332 Fixes: 93a9e7f3f ("core: Move code ignoring events on windows with modals to Wayland") Part-of: --- src/wayland/meta-wayland-pointer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 9d5a381cd..88b27f84d 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -603,7 +603,7 @@ repick_for_event (MetaWaylandPointer *pointer, surface = meta_surface_actor_wayland_get_surface (actor_wayland); - if (meta_window_has_modals (meta_wayland_surface_get_window (surface))) + if (surface && meta_window_has_modals (meta_wayland_surface_get_window (surface))) surface = NULL; } else