From 67438caa3d0be0ce615902b7183b93237494ee01 Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 11 Dec 2024 15:32:41 +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/gdkdevice-wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 7c4c926ce8..6c63ad34f8 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -1174,6 +1174,9 @@ data_device_enter (void *data, GdkWindow *dest_window, *dnd_owner; GdkAtom selection; + if (!surface) + return; + dest_window = wl_surface_get_user_data (surface); if (!GDK_IS_WINDOW (dest_window))