Repository navigation
Conversation
This was referenced Nov 1, 2026
This was referenced Nov 1, 2026
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
GitHub Issue: closes #25869
PR Type:
🐞 Bugfix
What changed? 🚀
The drag layer (
DragRoot) now enters the live tree whenInputManager.OpenDragAndDropadds it, and leaves it before it's removed. The drag visual is loaded while it's shown, so it shows the dragged element again.Before.
OpenDragAndDropadded the drag layer as a child of the visual tree's root element, which isn't active in the visual tree itself.VisualTree.AddRootenters each of its other roots explicitly (root.Enter(new EnterParams(isLive: true), 0)), but the drag layer was added without that. The drag visual was never live, and never loaded.Imageonly subscribes to its source once it's loaded, as WinUI only decodes in the live tree. So the drag visual'sImageshowed nothing:DragStarting, so no in-app drag showed the dragged element, only the caption tooltip;DragUI.SetContentFromBitmapImageorDragUIOverride.SetContentFromBitmapImage.After.
OpenDragAndDropenters the drag layer, live, right after adding it, asVisualTree.AddRootdoes for the other roots. It skips that if the layer is already active, in case the root element is active.VisualTree::RemoveRootdoes. The layer doesn't stay marked active after it's removed.Loaded, thenUnloadedwhen the drag ends, and the drag visual's image shows. The drag layer stays out of hit-testing (IsHitTestVisibleis false).Platforms: all, since the change is in shared code. Verified on Skia Desktop (Windows).
Tests:
Given_DragView.When_Shown_Then_Loaded_And_Content_Image_Decodesshows a drag visual twice in a row throughInputManager.OpenDragAndDrop, as the drag layer is removed after the first and added again for the second. Each time it has aBitmapImage(ms-appx:///Assets/square100.png) that nothing else shows. Each time, the test checks that:PixelWidth > 0);On Skia Desktop (Windows), on
masterat 1f2fc30:masterWhen_Shown_Then_Loaded_And_Content_Image_DecodesI also ran
Given_DragView,Given_Win32DragDrop, and the drag-and-drop tests ofGiven_UIElement,Given_ListViewBaseandGiven_TreeView: 25 tests, the new one included, all passing, after a build with the analyzers on.Backport: not needed in
servicing/6.8unless #25124'sImagechange is backported there.PR Checklist ✅
Screenshots Compare Test Runresults.