wayland: Fix some dnd corner case

We must call gdk_drag_drop_done() when the drag ends,
successfully or not. Without this, we get an unwarranted
emission of ::cancel after a successful drop.

Since only the first call to gdk_drag_drop_done() is taking
effect, it is safe to call as a fallback, after emitting
::dnd-finished. If the application connects to that signal
and calls gdk_drag_drop_done() itself, its call will take
precedence.

This matches what the X11 implementation does.
This commit is contained in:
Matthias Clasen 2021-06-19 06:57:38 -07:00
parent c8ad4d5deb
commit 4df9314039

View File

@ -163,6 +163,7 @@ gdk_wayland_drag_cancel (GdkDrag *drag,
GdkDragCancelReason reason)
{
gdk_drag_set_cursor (drag, NULL);
gdk_drag_drop_done (drag, FALSE);
}
static void
@ -290,6 +291,7 @@ data_source_dnd_finished (void *data,
GdkDrag *drag = data;
g_signal_emit_by_name (drag, "dnd-finished");
gdk_drag_drop_done (drag, TRUE);
}
static void