1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-27 02:20:05 +00:00

X11: Fix drag-n-drop bug in the XWindowSystem class

This resolves a regression which was introduced in
74ca3b44c4.

Prior to that commit, drag and drop on Linux/X11 worked as expected.
DragAndDropContainer::performExternalDragDropOfFiles allowed dropping
files onto other applications.

After the faulty commit, this function may cause the window manager to
enter a bad state in which the drag operation never finishes, making it
impossible to switch between windows or close windows.

I think the issue happens because the DnD source may receive (spurious?)
XdndLeave messages during the drag, which cause the peer's entry in the
dragAndDropStateMap to be removed. Before the faulty commit, each peer
had its own drag and drop state object, which was not destroyed in this
way.

This change will keep the peer's drag state object alive, even when an
XdndLeave message is received. The entry will still be removed when the
peer's window is destroyed.
This commit is contained in:
reuk 2021-04-13 14:54:18 +01:00
parent a06063dfd7
commit 146c8573ca
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -3617,7 +3617,6 @@ void XWindowSystem::handleClientMessageEvent (LinuxComponentPeer* peer, XClientM
else if (clientMsg.message_type == atoms.XdndLeave)
{
dragAndDropStateMap[peer].handleDragAndDropExit();
dragAndDropStateMap.erase (peer);
}
else if (clientMsg.message_type == atoms.XdndPosition)
{