From 01a1aaf99e203fda08a62462fe241a7bc50913d2 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Fri, 31 Mar 2023 13:52:20 +0200 Subject: [PATCH] Also send drop when it was not accepted This enables applications to distinguish - successful drop - drop onto client that didn't accept - cancelled drag --- src/wayland/seat_interface.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wayland/seat_interface.cpp b/src/wayland/seat_interface.cpp index 873642db67..23b1a7c639 100644 --- a/src/wayland/seat_interface.cpp +++ b/src/wayland/seat_interface.cpp @@ -258,7 +258,13 @@ void SeatInterfacePrivate::cancelDrag() drag.target->updateDragTarget(nullptr, 0); drag.target = nullptr; } - endDrag(); + QObject::disconnect(drag.dragSourceDestroyConnection); + if (drag.source) { + drag.source->dndCancelled(); + } + drag = Drag(); + Q_EMIT q->dragSurfaceChanged(); + Q_EMIT q->dragEnded(); } void SeatInterfacePrivate::endDrag() @@ -274,6 +280,7 @@ void SeatInterfacePrivate::endDrag() dragTargetDevice->drop(); dragSource->dropPerformed(); } else { + dragSource->dropPerformed(); dragSource->dndCancelled(); } }