diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-06-05 17:19:44 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-06-07 13:39:43 +0200 |
commit | f1011bd2ed3747880e08791fddbb63f73b0faffe (patch) | |
tree | 0dd9218ba03d0a90d0b1faf75a0a2d6a2161aae2 | |
parent | b006d6d9dea11ac788a54ee3ffd13a9463003a32 (diff) |
macOS: Don't assume DnD is handled via internal drag loop
If we have only one item, we're not using beginDraggingSessionWithItems
which requires us to manage our own drag loop, and instead use good old
dragImage, which takes care of the drag loop on our behalf.
In both cases we end up in draggingSession:endedAtPoint, so we need
to explicitly check for the existence of a manually managed drag session.
Amends 8a359343621fa83941946cb4e661b54ca7a1c4cc.
Fixes: QTBUG-114236
Pick-to: 6.5 6.6
Change-Id: Ifa9110945e191c4ffebe099e3e4edf9c571ab376
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoadrag.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index de45e8a979..a8c0392f8b 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -226,9 +226,10 @@ void QCocoaDrag::setAcceptedAction(Qt::DropAction act) void QCocoaDrag::exitDragLoop() { - Q_ASSERT(m_internalDragLoop); - if (m_internalDragLoop->isRunning()) + if (m_internalDragLoop) { + Q_ASSERT(m_internalDragLoop->isRunning()); m_internalDragLoop->exit(); + } } |