This commit is contained in:
Kovid Goyal 2026-04-07 13:47:47 +05:30
parent a90b8470ac
commit 837f55fe21
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

5
glfw/wl_window.c vendored
View file

@ -3420,12 +3420,13 @@ drag_source_dnd_finished(void *data UNUSED, struct wl_data_source *source UNUSED
static void
drag_source_cancelled(void *data UNUSED, struct wl_data_source *source UNUSED) {
debug_input("Drag source cancelled: has_toplevel: %d\n", !!_glfw.wl.drag.toplevel_xdg_toplevel);
// Uber competent Wayland people contravene their own spec and make it
// impossible to distinguish between drag cancelled and dropped but not
// accepted. https://gitlab.freedesktop.org/wayland/wayland/-/issues/140
// so we assume this is a drop unless we are in top-level mode. Sigh.
cancel_drag(_glfw.wl.drag.toplevel_xdg_toplevel ? GLFW_DRAG_CANCELLED : GLFW_DRAG_DROPPED);
const GLFWDragEventType t = _glfw.wl.drag.toplevel_xdg_toplevel ? GLFW_DRAG_CANCELLED : GLFW_DRAG_DROPPED;
debug_input("Drag source cancelled: is_drop: %d\n", t == GLFW_DRAG_DROPPED);
cancel_drag(t);
}