WindowsAppSDK
WindowsAppSDK copied to clipboard
[Documentation] AppWindowTitleBar uses physical pixels
Describe the bug
AppWindowTitleBar uses physical pixels instead of effective pixels, which can be quite unintuitive when you're calculating the rectangles based on the XAML layout. All values need to be scaled using XamlRoot.RasterizationScale to prevent issues on displays that aren't using a scaling factor of 1 (100%).
With WinUI being a departure from physical pixels, this behavior should imo be mentioned in the documentation, which impacts at least the following pages:
- AppWindowTitleBar.SetDragRectangles(RectInt32[])
- AppWindowTitleBar.LeftInset
- AppWindowTitleBar.RightInset
- Perhaps also AppWindowTitleBar.Height, not sure
This issue was raised among some other AppWindowTitleBar quirks here as well.
Steps to reproduce the bug
Use the given method/properties in code and observe the values/behavior.
Expected behavior
No response
Screenshots
No response
NuGet package version
1.0.0
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 21H2 (22000)
IDE
Visual Studio 2022
Additional context
No response
Does this also mean we need to handle it and update the rectangles when dragging a window across two monitors with different DPI? (and how would that affect the drag, changing the area I'm actively dragging?)