mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-09-27 13:57:09 +00:00
Merge pull request #571 from UnknownShadow200/develop
Fix X11 drag-n-drop returning wrong filename, and crashing
This commit is contained in:
commit
31faf624da
|
@ -344,8 +344,8 @@ namespace OpenTK.Platform.X11
|
||||||
string[] fileNames = new string[splitted.Length];
|
string[] fileNames = new string[splitted.Length];
|
||||||
for (int i = 0; i < splitted.Length; i++)
|
for (int i = 0; i < splitted.Length; i++)
|
||||||
{
|
{
|
||||||
// Delete start of name - file://
|
// Delete starting file://, filename data is URI-encoded
|
||||||
fileNames[i] = splitted[i].Substring(7);
|
fileNames[i] = Uri.UnescapeDataString(splitted[i].Substring(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileNames;
|
return fileNames;
|
||||||
|
@ -886,9 +886,9 @@ namespace OpenTK.Platform.X11
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
formats = Marshal.AllocHGlobal(3 * IntPtr.Size);
|
formats = Marshal.AllocHGlobal(3 * IntPtr.Size);
|
||||||
Marshal.WriteIntPtr(formats, e.ClientMessageEvent.ptr3);
|
Marshal.WriteIntPtr(formats, IntPtr.Size * 0, e.ClientMessageEvent.ptr3);
|
||||||
Marshal.WriteIntPtr(formats, IntPtr.Size * 2, e.ClientMessageEvent.ptr4);
|
Marshal.WriteIntPtr(formats, IntPtr.Size * 1, e.ClientMessageEvent.ptr4);
|
||||||
Marshal.WriteIntPtr(formats, IntPtr.Size * 3, e.ClientMessageEvent.ptr5);
|
Marshal.WriteIntPtr(formats, IntPtr.Size * 2, e.ClientMessageEvent.ptr5);
|
||||||
formatCount = 3;
|
formatCount = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue