1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

X11: Correctly reset drag and drop state when drag has ended

This commit is contained in:
ed 2021-11-03 15:10:33 +00:00
parent 75c1d69f0a
commit fdd9eb8eeb

View file

@ -273,6 +273,8 @@ public:
{
if (auto* peer = getPeerFor (windowH))
peer->handleDragExit (dragInfo);
resetDragAndDrop();
}
void handleDragAndDropSelection (const XEvent& evt)
@ -339,6 +341,8 @@ public:
if (completionCallback != nullptr)
completionCallback();
dragging = false;
}
bool externalDragInit (::Window window, bool text, const String& str, std::function<void()>&& cb)
@ -566,12 +570,23 @@ private:
ComponentPeer::DragInfo dragInfoCopy (dragInfo);
sendDragAndDropFinish();
resetDragAndDrop();
if (! dragInfoCopy.isEmpty())
if (auto* peer = getPeerFor (windowH))
peer->handleDragDrop (dragInfoCopy);
}
void resetDragAndDrop()
{
dragInfo.clear();
dragInfo.position = Point<int> (-1, -1);
dragAndDropCurrentMimeType = 0;
dragAndDropSourceWindow = 0;
srcMimeTypeAtomList.clear();
finishAfterDropDataReceived = false;
}
//==============================================================================
::Window windowH = 0, targetWindow = 0, dragAndDropSourceWindow = 0;