From 3322e4fa54f4c234a54eb6c6cc0890d6479ef0c1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 8 Feb 2021 18:21:29 +0100 Subject: [PATCH] surface-actor-wayland: Handle Xwayland vanishing gracefully When a game is playing fullscreen, mutter may use a direct scanout of the surface. However, if that surface is from Xwayland and Xwayland had vanished (now that mutter can survive that), the actual surface might be NULL, so check for that case to avoid a crash. Close: https://gitlab.gnome.org/GNOME/mutter/-/issues/1638 Part-of: --- src/compositor/meta-surface-actor-wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c index eba68fe49..a182ad851 100644 --- a/src/compositor/meta-surface-actor-wayland.c +++ b/src/compositor/meta-surface-actor-wayland.c @@ -74,6 +74,9 @@ meta_surface_actor_wayland_try_acquire_scanout (MetaSurfaceActorWayland *self, CoglScanout *scanout; surface = meta_surface_actor_wayland_get_surface (self); + if (!surface) + return NULL; + scanout = meta_wayland_surface_try_acquire_scanout (surface, onscreen); if (!scanout) return NULL;