[mutter/gnome-3-36] wayland/subsurface: Check for parent actor before unparenting



commit 465037fede0ec2b42a928acb20cf8ea4ab5783bf
Author: Robert Mader <robert mader posteo de>
Date:   Fri Aug 6 13:12:26 2021 +0200

    wayland/subsurface: Check for parent actor before unparenting
    
    No need to assume the actor still has a parent. This silences warnings
    in normal builds and prevents a crash in fully optimized ones.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1958>

 src/wayland/meta-wayland-subsurface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index d16172bda8..de336f60f5 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -291,7 +291,8 @@ unparent_actor (MetaWaylandSurface *surface)
     return;
 
   parent_actor = clutter_actor_get_parent (actor);
-  clutter_actor_remove_child (parent_actor, actor);
+  if (parent_actor)
+    clutter_actor_remove_child (parent_actor, actor);
 }
 
 static void


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