Conversation
The assembly list answered DragOver with the Move effect only. OLE intersects that answer with the effects the drag source permits, and sources such as FileLocator Pro only permit Copy, so the negotiation ended in None and the drop was refused although CF_HDROP was present and the file path resolved fine. Explorer permits Move, which is why drops from Explorer kept working. The WPF ILSpy offered Move, Copy and Link and let the source pick; restore that. Assisted-by: Claude:claude-fable-5:Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4054.
Symptom
Dragging a managed DLL from the search results of a third-party program such as FileLocator Pro onto the assembly list shows the no-drop cursor and the file is never opened. Dragging the same file from Windows Explorer works. ILSpy 10 (WPF) accepted both.
What was ruled out
The natural suspect was the data object. WPF's
DataObject.GetDataPresent(DataFormats.FileDrop)asks the source viaIDataObject::QueryGetData, while Avalonia's Win32 backend (OleDataObjectToDataTransferWrapper.ProvideFormats) builds its format list solely fromIDataObject::EnumFormatEtc, so a source that servesCF_HDROPwithout enumerating it would be invisible to Avalonia. That is not the case here: a trace inSharpTreeView.OnDragOvershowed FileLocator Pro enumeratesCF_HDROP(DataFormat.File) plusShell IDList Array,TryGetFiles()returns the item, andTryGetLocalPath()resolves the full path.AssemblyListTreeNode.CanDroptherefore returnedtrue.Actual cause
The effect negotiation.
AssemblyListTreeNode.CanDropanswered DragOver withXPlatDragDropEffects.Moveonly. Avalonia passes that back to OLE as*pdwEffect, and OLE intersects it with the effects the drag source allowed inDoDragDrop. FileLocator Pro's source only permitsDROPEFFECT_COPY(it offers files to read, not to move), soMove & Copy == Noneand Windows shows the no-drop cursor. Explorer permits Move/Copy/Link, which is why Explorer drops kept working and masked the bug. VS Code accepts these drags because it answers Copy.The WPF
AssemblyListTreeNode.CanDropin ILSpy 10 answeredMove | Copy | Linkand let the source pick whichever it permits; the Avalonia port narrowed that toMove.Fix
Offer
Move | Copy | Linkagain inAssemblyListTreeNode.CanDrop. The effect only influences the cursor and the negotiation;Dropopens the files and moves them into position regardless of which effect was chosen, so the internal reorder drag is unaffected.Verified manually with FileLocator Pro and Explorer;
AssemblyTreeFileDropTestspass.