summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Kinloch <colin.kinloch@collabora.com>2023-03-15 18:35:22 +0000
committerRobert Mader <robert.mader@collabora.com>2023-03-20 14:58:25 +0100
commitb2089b9d9a0fc92e152977f784917a3181d5f86f (patch)
tree387e0a12ed888889df3d87c222b3285be89ababe
parent78248ea0d83c936f3e2de97d43f3a7ab39039776 (diff)
downloadmutter-b2089b9d9a0fc92e152977f784917a3181d5f86f.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> (cherry picked from commit 76ce6a0ab5975062ffe1f8b885b9be650b60e5a7)
-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 53c35c5dc..d141483be 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -466,13 +466,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);