Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x11] Fix drag & drop receiving incorrect file with some file managers #121

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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