Skip to content

Conversation

@MartinZikmund
Copy link
Member

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:

Other information ℹ️

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.
@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 12:45
@MartinZikmund MartinZikmund self-assigned this Oct 23, 2025
@github-actions github-actions bot added the area/automation Categorizes an issue or PR as relevant to project automation label Oct 23, 2025
Copy link
Contributor

Copilot AI left a 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 DragEventSource to accept a Point instead 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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 12:46
Copy link
Contributor

Copilot AI left a 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>
@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 12:47
Copy link
Contributor

Copilot AI left a 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.

@unodevops
Copy link
Contributor

🤖 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

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21669/docs/index.html

@unodevops
Copy link
Contributor

🤖 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

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21669/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 179449 has failed on Uno.UI - CI.

@nventive-devops
Copy link
Contributor

The build 179449 found UI Test snapshots differences: android-28-net9: 20, android-28-net9-Snap: 40, ios: 5, ios-Snap: 49, skia-linux-screenshots: 95, skia-windows-screenshots: 63, wasm: 114, wasm-automated-net10.0-WinUI-Benchmarks-automated: 0, wasm-automated-net10.0-WinUI-Default-automated: 14, wasm-automated-net10.0-WinUI-RuntimeTests-0: 0, wasm-automated-net10.0-WinUI-RuntimeTests-1: 0, wasm-automated-net10.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net9: 20 changed over 825

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
    • FlyoutTest_When_NoOverlayInputPassThroughElement_Then_DontPassThrough_woOff_UITests_Shared_Windows_UI_Xaml_Controls_Flyout_Flyout_OverlayInputPassThroughElement
    • NativeCommandBar_Size_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Dynamic
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Simple_ContentDialog_01_Primary_UITests_Shared_Windows_UI_Xaml_Controls_ContentDialogTests_ContentDialog_Simple
    • Simple_ContentDialog_01_Close_UITests_Shared_Windows_UI_Xaml_Controls_ContentDialogTests_ContentDialog_Simple
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • WebView_NavigateToLongString_AfterSuccess
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • android-28-net9-Snap: 40 changed over 1075

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_ImageBrushChangingCornerRadius_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushChangingCornerRadius
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Basic_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Basic
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromMsAppData_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_FromMsAppData
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Grid_Grid_with_OutOfRange_Cells_UITests_Shared_Windows_UI_Xaml_Controls_GridTestsControl_Grid_with_OutOfRange_Cells
    • TabView_MUXControlsTestApp_TabViewPage_MUXControlsTestApp_TabViewPage
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • Image_LargeImageList_Uno_UI_Samples_UITests_LargeImageList
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
    • MUX_NumberBox_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • Icons_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground_UITests_Shared_Windows_UI_Xaml_Controls_BitmapIconTests_BitmapIcon_Foreground
    • CommandBar_Examples_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Examples
    • ListView_ListViewResizable_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewResizable
    • ListView_ListViewScrollIntoViewSnapPoints_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewScrollIntoViewSnapPoints
    • Scrolling_MUXControlsTestApp_ScrollViewWithScrollControllersPage_MUXControlsTestApp_ScrollViewWithScrollControllersPage
    • CommandBarFlyout_MUXControlsTestApp_CommandBarFlyoutPage_MUXControlsTestApp_CommandBarFlyoutPage
    • GridView_Uno_UI_Samples_Content_UITests_GridView_GridView_Item_TextBlock_And_Button_Uno_UI_Samples_Content_UITests_GridView_GridView_Item_TextBlock_And_Button
  • ios: 5 changed over 255

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • ImageStretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Check_ListView_Swallows_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
  • ios-Snap: 49 changed over 992

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ContentControl_ContentControl_SelectorInheritance_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_SelectorInheritance
    • Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
    • NavigationView_MUXControlsTestApp_PaneLayoutTestPage_MUXControlsTestApp_PaneLayoutTestPage
    • NavigationView_NavigationView_BasicNavigation_SamplesApp_Samples_Windows_UI_Xaml_Controls_NavigationViewTests_NavigationView_BasicNavigation
    • Performance_UITests_Windows_UI_Xaml_Performance_Performance_1000ButtonsContinuousRendering_UITests_Windows_UI_Xaml_Performance_Performance_1000ButtonsContinuousRendering
    • Brushes_RectangleStretchFill_Uno_UI_Samples_UITests_ImageBrushTestControl_RectangleStretchFill
    • NavigationView_MUXControlsTestApp_NavigationViewCompactPaneLengthTestPage_MUXControlsTestApp_NavigationViewCompactPaneLengthTestPage
    • Popup_MessageDialog_UITests_Shared_Windows_UI_Xaml_Controls_Popup_MessageDialog
    • Brushes_ImageBrushStretch2_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushStretch2
    • Grid_CenteredGridinGridwiththreefixedsizechildren_Uno_UI_Samples_Content_UITests_GridTestsControl_CenteredGridinGridwiththreefixedsizechildren
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Bigger
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Equal
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller
    • NavigationView_NavigationView_Tapped_UITests_Shared_Windows_UI_Xaml_Controls_NavigationViewTests_NavigationView_Tapped
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
    • ColorPicker_WinUIColorPickerPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ColorPickerTests_WinUIColorPickerPage
    • Flyouts_UITests_Windows_UI_Xaml_Controls_Flyout_Flyout_TemplatedParent_UITests_Windows_UI_Xaml_Controls_Flyout_Flyout_TemplatedParent
  • skia-linux-screenshots: 95 changed over 2292

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • Grid_with_Stack_Panel_and_Trimming.png-dark
    • Grid_with_Stack_Panel_and_Trimming.png
    • Buttons.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png
    • ButtonClippingTestsControl.png-dark
    • ClipboardTests.png
    • CalendarView_Theming.png-dark
    • Examples.png-dark
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DropDownButtonPage.png-dark
    • FontIconControlTest.png-dark
    • FontIconControlTest.png
    • EllipsemaskingEllipseGrid.png-dark
  • skia-windows-screenshots: 63 changed over 2292

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png
    • Image_Stretch_None.png-dark
    • Image_Stretch_None.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
  • wasm: 114 changed over 1056

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • initial_state
    • SamplesApp.Samples.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_BasicNavigation
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_DataContext_Propagation
    • UITests.Windows_UI_Xaml_Controls.ListView.ListView_DisplayMemberPath
    • UITests.Windows_UI_Xaml_Controls.ListView.ListView_DuplicateItem
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_Description
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_Focus_Programmatic
    • UITests.Windows_UI_Xaml_Controls.TextBox.TextBox_Foreground_Changing
    • UITests.Windows_UI_Xaml_Media_Animation.DoubleAnimation_FinalState_Opacity
    • GenericApp.Views.Samples.Shared.Content.UITests.GridViewMultipleSelectionMode
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Padding_Unconstrained
    • UITests.Shared.Windows_ApplicationModel.Calls.PhoneCallManagerTests
    • UITests.Shared.Windows_UI_Xaml_Controls.Button.Overlapped_Buttons
    • UITests.Shared.Windows_UI_Xaml_Controls.PasswordBoxTests.PasswordBoxPage
    • UITests.Shared.Windows_UI_Xaml_Controls.Popup.MessageDialog
    • UITests.Shared.Windows_UI_Xaml_Controls.WebView.WebView_NavigateToString2
    • UITests.Windows_UI_ViewManagement.ApplicationViewSizing
    • UITests.Windows_UI_Xaml_Controls.ListView.ListViewItem_IsEnabled
    • UITests.Windows_UI_Xaml_Controls.TextBlockControl.TextBlock_IsTextSelectionEnabled
    • Uno.UI.Samples.Content.UITests.ButtonTestsControl.Buttons
  • wasm-automated-net10.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net10.0-WinUI-Default-automated: 14 changed over 877

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_StrokeThickness_MyEllipse
    • Default_StrokeThickness_MyPolygon
    • When_StretchAndAlignmentNone_ImageBrush-50-50-None-XLeft-YBottom
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • Default_StrokeThickness_MyPath
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Default_StrokeThickness_MyLine
    • Default_StrokeThickness_MyPolyline
    • Default_StrokeThickness_MyRect
  • wasm-automated-net10.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-2: 0 changed over 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants