wayland: Double check surface/window before looking for modals
While it should not be expected that we pick the pointer into a MetaSurfaceActor that is disembodied of its MetaWaylandSurface/MetaWindow, the paths where this should be enforced are somewhat scattered. So account for the situation in picking code, and prefer a NULL surface over a crash. This operates on the assumption that this inconsistent state where Mutter didn't know better to pick a correct surface actor will be fixed by later crossing events resolving the intermediate state, and that no other input events will be received meanwhile. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3393 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3729>
This commit is contained in:
@ -600,10 +600,13 @@ repick_for_event (MetaWaylandPointer *pointer,
|
|||||||
{
|
{
|
||||||
MetaSurfaceActorWayland *actor_wayland =
|
MetaSurfaceActorWayland *actor_wayland =
|
||||||
META_SURFACE_ACTOR_WAYLAND (actor);
|
META_SURFACE_ACTOR_WAYLAND (actor);
|
||||||
|
MetaWindow *window = NULL;
|
||||||
|
|
||||||
surface = meta_surface_actor_wayland_get_surface (actor_wayland);
|
surface = meta_surface_actor_wayland_get_surface (actor_wayland);
|
||||||
|
if (surface)
|
||||||
|
window = meta_wayland_surface_get_window (surface);
|
||||||
|
|
||||||
if (surface && meta_window_has_modals (meta_wayland_surface_get_window (surface)))
|
if (window && meta_window_has_modals (window))
|
||||||
surface = NULL;
|
surface = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user