Also send drop when it was not accepted

This enables applications to distinguish
- successful drop
- drop onto client that didn't accept
- cancelled drag
This commit is contained in:
David Redondo 2023-03-31 13:52:20 +02:00 committed by David Edmundson
parent 3a95c20279
commit 01a1aaf99e

View file

@ -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();
}
}