You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
InputNonClientPointerSource.SetRegionRects with NonClientRegionKind.Passthrough fails to apply the provided excluded regions when Display scale is changed to higher value
#10151
Using the full example at https://learn.microsoft.com/en-us/windows/apps/develop/title-bar, with modified toolbar layout. The calculation of the excluded rectangles is fully detailed in the application debug traces below. The calculation is correct, and works as long as the Display scale is not changed or is set to a lower value. Note that reproduction works with changing the Display Scale in the Settings App or by dragging the window between two monitors with different Display Scale.
If the Display Scale is changed to a Higher value (from 150% to 175% for example), the calculation of the excluded region is correct, but the call to InputNonClientPointerSource.SetRegionRects() does not properly apply the regions. The old rectangle for the padding right in the traces below is still the one active.
SetRegionsForCustomTitleBar: 1.75
SetRegionsForCustomTitleBar: padding left=0 , right=123.42857360839844
SetRegionsForCustomTitleBar: primary width=46 , height=46
SetRegionsForCustomTitleBar: secondary width=92 , height=46
--> Change Scale to 150% , rectangles properly excluded
SetRegionsForCustomTitleBar
SetRegionsForCustomTitleBar: 1.5
SetRegionsForCustomTitleBar: padding left=0 , right=144
SetRegionsForCustomTitleBar: primary width=40 , height=39
SetRegionsForCustomTitleBar: secondary width=79 , height=39
--> Change Scale back to 175%, rectangles not properly excluded, the right padding area is still as if it were 144
SetRegionsForCustomTitleBar
SetRegionsForCustomTitleBar: 1.75
SetRegionsForCustomTitleBar: padding left=0 , right=123.42857360839844
SetRegionsForCustomTitleBar: primary width=46 , height=46
SetRegionsForCustomTitleBar: secondary width=92 , height=46
--> Maximize then restore the Window => excluded rectangles are now applied, although the bounds did not change of course.
SetRegionsForCustomTitleBar
SetRegionsForCustomTitleBar: 1.75
SetRegionsForCustomTitleBar: padding left=0 , right=123.42857360839844
SetRegionsForCustomTitleBar: primary width=46 , height=46
SetRegionsForCustomTitleBar: secondary width=92 , height=46
Make the PersonPicture interactive, a button for example.
Change Display Scale with Windows 11 Settings App.
Expected behavior
Excluded regions should be applied as provided when Display scale is set to a higher value or when the application window is moved across monitors with different display scale, or when they are programmatically changed... Basically honor the rectangles provided to the API call.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Using the full example at https://learn.microsoft.com/en-us/windows/apps/develop/title-bar, with modified toolbar layout. The calculation of the excluded rectangles is fully detailed in the application debug traces below. The calculation is correct, and works as long as the Display scale is not changed or is set to a lower value. Note that reproduction works with changing the Display Scale in the Settings App or by dragging the window between two monitors with different Display Scale.
If the Display Scale is changed to a Higher value (from 150% to 175% for example), the calculation of the excluded region is correct, but the call to
InputNonClientPointerSource.SetRegionRects()
does not properly apply the regions. The old rectangle for the padding right in the traces below is still the one active.Steps to reproduce the bug
Use the Microsoft sample at https://learn.microsoft.com/en-us/windows/apps/develop/title-bar
Make the PersonPicture interactive, a button for example.
Change Display Scale with Windows 11 Settings App.
Expected behavior
Excluded regions should be applied as provided when Display scale is set to a higher value or when the application window is moved across monitors with different display scale, or when they are programmatically changed... Basically honor the rectangles provided to the API call.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered: