Skip to content

Commit

Permalink
Fix: Fixed issues with drag & drop to other applications (#16628)
Browse files Browse the repository at this point in the history
  • Loading branch information
gave92 authored Dec 21, 2024
1 parent 177dbfe commit bfb0e4e
Showing 1 changed file with 3 additions and 7 deletions.
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

0 comments on commit bfb0e4e

Please sign in to comment.