Skip to content

Commit

Permalink
[x11] Fix drag & drop receiving incorrect file with some file managers
Browse files Browse the repository at this point in the history
On Dolphin file manager, dropping file always returns the first file.
  • Loading branch information
56789a1987 authored and dacap committed Dec 18, 2024
1 parent 8a9158a commit f241165
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion os/x11/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,13 +1252,17 @@ void WindowX11::processX11Event(XEvent& event)
XSendEvent(m_display, sourceWindow, 0, 0, &event2);
}
else if (event.xclient.message_type == XdndDrop) {
// The time stamp must be passed to XConvertSelection
// to insure that the correct data is received.
const Time time = event.xclient.data.l[2];

// Save the X11 window from where this XdndDrop message came
// from, so then we can send a XdndFinished later.
g_dndSource = (::Window)event.xclient.data.l[0];

// Ask for the XdndSelection, we're going to receive the
// dropped items in the SelectionNotify.
XConvertSelection(m_display, XdndSelection, URI_LIST, XdndSelection, m_window, CurrentTime);
XConvertSelection(m_display, XdndSelection, URI_LIST, XdndSelection, m_window, time);
}
break;

Expand Down

0 comments on commit f241165

Please sign in to comment.