wayland: Don't crash when trying to fullscreen on inert wl_output

There is a race where an output can be used as a fullscreen target, but
it has already been removed due to a hotplug. Handle this gracefully by
ignoring said output in such situations.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1120
This commit is contained in:
Jonas Ådahl 2020-03-11 13:27:07 +01:00 committed by Florian Müllner
parent d2a12ee0fa
commit 512bb7d1cd
2 changed files with 2 additions and 2 deletions

View File

@ -439,7 +439,7 @@ zxdg_toplevel_v6_set_fullscreen (struct wl_client *client,
if (output_resource)
{
MetaWaylandOutput *output = wl_resource_get_user_data (output_resource);
if (output)
if (output && output->logical_monitor)
meta_window_move_to_monitor (window, output->logical_monitor->number);
}

View File

@ -456,7 +456,7 @@ xdg_toplevel_set_fullscreen (struct wl_client *client,
{
MetaWaylandOutput *output = wl_resource_get_user_data (output_resource);
if (output)
if (output && output->logical_monitor)
{
meta_window_move_to_monitor (window,
output->logical_monitor->number);