wayland/surface: Check for surface role in meta_wayland_surface_get_window()

The function can get called without valid surface role, e.g. from
`zwp_xwayland_keyboard_grab_manager_grab()`.

Debugged by @piegamesde

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1147
This commit is contained in:
Robert Mader 2020-03-30 15:53:29 +02:00
parent 2907ee93cc
commit dbe919ef92

View File

@ -1745,6 +1745,9 @@ meta_wayland_surface_role_get_window (MetaWaylandSurfaceRole *surface_role)
MetaWindow *
meta_wayland_surface_get_window (MetaWaylandSurface *surface)
{
if (!surface->role)
return NULL;
return meta_wayland_surface_role_get_window (surface->role);
}