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



commit 512bb7d1cd0836e6d110609a16fdbf9f9f5b30df
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Mar 11 13:27:07 2020 +0100

    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

 src/wayland/meta-wayland-legacy-xdg-shell.c | 2 +-
 src/wayland/meta-wayland-xdg-shell.c        | 2 +-
 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 e438f2460..eba802e0c 100644
--- a/src/wayland/meta-wayland-legacy-xdg-shell.c
+++ b/src/wayland/meta-wayland-legacy-xdg-shell.c
@@ -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);
     }
 
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index fefed4596..d8f639757 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]