From df60eef0dbb2f02b7d0dec0e176e8648f39b183b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 16 May 2024 09:45:51 +0100 Subject: [PATCH] wayland: Send dnd_cancelled to source before data_device.leave to target Otherwise it is harder for clients to detect an actual cancellation when dragging to itself. --- src/wayland/seat.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wayland/seat.cpp b/src/wayland/seat.cpp index 9698156f6f..1b854d7993 100644 --- a/src/wayland/seat.cpp +++ b/src/wayland/seat.cpp @@ -255,14 +255,14 @@ void SeatInterfacePrivate::registerPrimarySelectionDevice(PrimarySelectionDevice void SeatInterfacePrivate::cancelDrag() { - if (drag.target) { - drag.target->updateDragTarget(nullptr, 0); - drag.target = nullptr; - } QObject::disconnect(drag.dragSourceDestroyConnection); if (drag.source) { drag.source->dndCancelled(); } + if (drag.target) { + drag.target->updateDragTarget(nullptr, 0); + drag.target = nullptr; + } drag = Drag(); Q_EMIT q->dragSurfaceChanged(); Q_EMIT q->dragEnded();