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
This commit is contained in:
Jehan 2024-12-11 15:32:41 +01:00 committed by Carlos Garnacho
parent 802284646f
commit 67438caa3d

View File

@ -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))