-
Notifications
You must be signed in to change notification settings - Fork 818
[Win32] Drag & drop indicator position #21669
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
base: master
Are you sure you want to change the base?
Conversation
Enhanced the `Description` attribute in `DragDrop_Files.xaml.cs` within the `UITests.Windows_UI_Xaml.DragAndDrop` namespace. The updated description now includes a multi-line string that provides additional details about the drag indicator's behavior when screen scaling is not 100%. This ensures clarity on the expected rendering above the mouse cursor, regardless of its position in the app's window, thereby improving the understanding of the test scenario and expected outcomes.
Added a `GetScaledPosition` method in `Win32DragDropExtension` to scale drag-drop positions using `XamlRoot.RasterizationScale`. Updated `DragEnter`, `DragOver`, and `Drop` methods to use scaled positions. Modified `DragEventSource` to accept a `Point` object. Introduced `AppWindow` property in `CoreDragDropManager` for window management.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the drag-and-drop indicator positioning on HDPI (high-DPI) screens in Win32 applications by properly scaling pointer coordinates according to the rasterization scale.
Key Changes:
- Added scaling logic to convert screen coordinates to properly scaled XAML coordinates
- Refactored
DragEventSourceto accept aPointinstead of separate x/y coordinates - Updated test documentation to include HDPI scaling verification instructions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| CoreDragDropManager.cs | Added AppWindow property to expose the associated window for the manager |
| Win32DragDropExtension.cs | Implemented GetScaledPosition method and applied scaling to all drag operations (DragEnter, DragOver, Drop) |
| DragDrop_Files.xaml.cs | Updated test description to include HDPI scaling verification steps |
src/Uno.UI.Runtime.Skia.Win32/ApplicationMode/DataTransfer/DragDrop/Win32DragDropExtension.cs
Outdated
Show resolved
Hide resolved
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/DragAndDrop/DragDrop_Files.xaml.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
src/Uno.UWP/ApplicationModel/DataTransfer/DragDrop/Core/CoreDragDropManager.cs
Outdated
Show resolved
Hide resolved
src/Uno.UI.Runtime.Skia.Win32/ApplicationMode/DataTransfer/DragDrop/Win32DragDropExtension.cs
Show resolved
Hide resolved
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21669/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21669/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21669/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21669/docs/index.html |
|
|
|
The build 179449 found UI Test snapshots differences: Details
|
GitHub Issue: closes https://github.com/unoplatform/kahua-private/issues/353
PR Type: 🐞 Bugfix
What is the current behavior? 🤔
On HDPI screens the d&d indicator position might have become misaligned against the position of the pointer.
What is the new behavior? 🚀
Scaling the position properly
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️