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:
parent
75c1d69f0a
commit
fdd9eb8eeb
1 changed files with 15 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue