summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-03-11 12:27:07 +0000
committerJonas Ådahl <jadahl@gmail.com>2020-03-12 20:46:43 +0000
commit57992f37cc87ffaa68ccd9ef962f7badd8d6fcf4 (patch)
treec42221938ef97a49c7dd0c96e33daca8e6462a41
parent7655a63af6b27fab28aa1f7f3595f8cc055d56cf (diff)
downloadmutter-57992f37cc87ffaa68ccd9ef962f7badd8d6fcf4.tar.gz
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 (cherry picked from commit 512bb7d1cd0836e6d110609a16fdbf9f9f5b30df)
-rw-r--r--src/wayland/meta-wayland-legacy-xdg-shell.c2
-rw-r--r--src/wayland/meta-wayland-xdg-shell.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c
index 0311a264a..32551a843 100644
--- a/src/wayland/meta-wayland-legacy-xdg-shell.c
+++ b/src/wayland/meta-wayland-legacy-xdg-shell.c
@@ -434,7 +434,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);
}
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 7b1bff579..354f8f652 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -431,7 +431,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);