From 640b8634d0061f5c489c05246c36eeb98696d24d Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 11 Dec 2024 15:43:09 +0100 Subject: [PATCH] gdk: fix crash on Wayland with already destroyed surface. See crash reliably reproduced on GIMP when a popup is destroyed on a drag-begin callback and Wayland data listener callbacks calls the enter() callback with a NULL surface. Cf. https://gitlab.gnome.org/GNOME/gimp/-/issues/10515 --- gdk/wayland/gdkseat-wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/wayland/gdkseat-wayland.c b/gdk/wayland/gdkseat-wayland.c index 7ce5ddfb01f..a799ac7369f 100644 --- a/gdk/wayland/gdkseat-wayland.c +++ b/gdk/wayland/gdkseat-wayland.c @@ -346,6 +346,9 @@ data_device_enter (void *data, GdkContentFormats *formats; GdkDevice *device; + if (!surface) + return; + dest_surface = wl_surface_get_user_data (surface); if (!GDK_IS_SURFACE (dest_surface)) -- GitLab