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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3660>
This commit is contained in:
Carlos Garnacho 2024-03-13 18:08:10 +01:00 committed by Marge Bot
parent 683e917854
commit 1cfc1aa92b

View File

@ -603,7 +603,7 @@ repick_for_event (MetaWaylandPointer *pointer,
surface = meta_surface_actor_wayland_get_surface (actor_wayland); 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; surface = NULL;
} }
else else