Fix ScreenshotMetadata drag drop (#843)

Provide the full path to dragEnterCef instead of only the file name.
This commit is contained in:
Nekromateion
2024-07-22 11:36:22 +02:00
committed by GitHub
parent 85cea30e77
commit 4f336195f0
+3 -3
View File
@@ -16,9 +16,9 @@ namespace VRCX
{ {
public bool OnDragEnter(IWebBrowser chromiumWebBrowser, IBrowser browser, IDragData dragData, DragOperationsMask mask) public bool OnDragEnter(IWebBrowser chromiumWebBrowser, IBrowser browser, IDragData dragData, DragOperationsMask mask)
{ {
if (dragData.IsFile && dragData.FileNames != null && dragData.FileNames.Count > 0) if (dragData.IsFile && dragData.FilePaths != null && dragData.FilePaths.Count > 0)
{ {
string file = dragData.FileNames[0]; string file = dragData.FilePaths[0];
if (!file.EndsWith(".png") && !file.EndsWith(".jpg") && !file.EndsWith(".jpeg")) if (!file.EndsWith(".png") && !file.EndsWith(".jpg") && !file.EndsWith(".jpeg"))
{ {
dragData.Dispose(); dragData.Dispose();
@@ -26,7 +26,7 @@ namespace VRCX
} }
// forgive me father for i have sinned once again // forgive me father for i have sinned once again
AppApi.Instance.ExecuteAppFunction("dragEnterCef", dragData.FileNames[0]); AppApi.Instance.ExecuteAppFunction("dragEnterCef", file);
dragData.Dispose(); dragData.Dispose();
return false; return false;
} }