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

Fix: Fixed issues with drag & drop to other applications #16628

Merged
merged 1 commit into from
Dec 21, 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
10 changes: 3 additions & 7 deletions src/Files.App/Views/Layouts/BaseLayoutPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.System;
using WinRT;
using static Files.App.Helpers.PathNormalization;
using DispatcherQueueTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer;
using SortDirection = Files.App.Data.Enums.SortDirection;
Expand Down Expand Up @@ -999,13 +1000,8 @@ protected virtual void FileList_DragItemsStarting(object sender, DragItemsStarti
{
var iddo = shellItemList[0].Parent.GetChildrenUIObjects<IDataObject>(HWND.NULL, shellItemList);
shellItemList.ForEach(x => x.Dispose());

var format = System.Windows.Forms.DataFormats.GetFormat("Shell IDList Array");
if (iddo.TryGetData<byte[]>((uint)format.Id, out var data))
{
var mem = new MemoryStream(data).AsRandomAccessStream();
e.Data.SetData(format.Name, mem);
}
var dataObjectProvider = e.Data.As<Shell32.IDataObjectProvider>();
dataObjectProvider.SetDataObject(iddo);
}
else
{
Expand Down