summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Kinloch <colin.kinloch@collabora.com>2023-03-15 18:35:22 +0000
committerRobert Mader <robert.mader@posteo.de>2023-03-20 13:29:24 +0000
commit76ce6a0ab5975062ffe1f8b885b9be650b60e5a7 (patch)
treec728966c65717e1be772ccc66cd253c7fac166b5
parent0e7506ff6d8e4940fc6654f2711e5decb23440dc (diff)
downloadmutter-76ce6a0ab5975062ffe1f8b885b9be650b60e5a7.tar.gz
wayland: Skip subsurface desync if parent is NULL
In order to avoid crashes when a client already destroyed the parent wl_surface. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2917>
-rw-r--r--src/wayland/meta-wayland-subsurface.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index f044c525b..9c806357c 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -462,13 +462,15 @@ wl_subsurface_set_desync (struct wl_client *client,
struct wl_resource *resource)
{
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
+ MetaWaylandSurface *parent;
gboolean is_parent_effectively_synchronized;
- if (!surface->sub.synchronous)
+ parent = surface->sub.parent;
+ if (!parent || !surface->sub.synchronous)
return;
is_parent_effectively_synchronized =
- is_surface_effectively_synchronized (surface->sub.parent);
+ is_surface_effectively_synchronized (parent);
if (!is_parent_effectively_synchronized)
meta_wayland_surface_apply_cached_state (surface);