[mutter] surface-actor-wayland: Handle Xwayland vanishing gracefully



commit 3322e4fa54f4c234a54eb6c6cc0890d6479ef0c1
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Mon Feb 8 18:21:29 2021 +0100

    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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1718>

 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 eba68fe496..a182ad8513 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;


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