From d6d6dc65c13dff31a32b989a69f94f709131ba44 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Tue, 15 Nov 2022 00:46:14 +0100 Subject: [PATCH] window-actor/wayland: Do not crash when there is no monitor When all monitors are blanking or after suspending there might not be any monitors temporarily. We can't draw a black background when we don't know the size of the monitor it's fullscreen on but it's fine because there actually is no monitor. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2508 Part-of: --- src/compositor/meta-window-actor-wayland.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c index 3abe588c9..3b87f0139 100644 --- a/src/compositor/meta-window-actor-wayland.c +++ b/src/compositor/meta-window-actor-wayland.c @@ -415,11 +415,14 @@ maybe_configure_black_background (MetaWindowActorWayland *self, float max_height = 0; if (!meta_window_wayland_is_acked_fullscreen (META_WINDOW_WAYLAND (window))) - return FALSE; + return FALSE; geometry_scale = meta_window_actor_get_geometry_scale (window_actor); logical_monitor = meta_window_get_main_logical_monitor (window); + if (!logical_monitor) + return FALSE; + fullscreen_layout = meta_logical_monitor_get_layout (logical_monitor); clutter_actor_iter_init (&iter, CLUTTER_ACTOR (self->surface_container));