1
0
Fork 0

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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3783>
This commit is contained in:
Sebastian Wick 2024-05-27 14:20:08 +02:00
parent dbdc8dd958
commit 3e7b1d9cbd
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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,