Skip to content

Fix PopupBox misalignment on mixed DPI systems #3641

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

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

Nextra
Copy link
Contributor

@Nextra Nextra commented Aug 1, 2024

PopupBox correctly transforms from device coordinates using the PresentationSource transform matrix, but then uses the global system DPI to transform back to device coordinates. This causes placement issues on systems with multiple DPI/scaling settings.

These examples were captured on a system with mixed scaling of 100% on the primary screen and 225% on the secondary, with the demo app placed on the latter.

Before:

image

After:

image

I chose BottomAndAlignRightEdges because the misalignment is particularly noticeable, but ultimately every placement mode is misaligned.

PopupBox correctly transforms from device coordinates using the
PresentationSource transform matrix, but then uses the global system DPI to
transform back to device coordinates. This causes placement issues on systems
with multiple DPI/scaling settings.
@Keboo Keboo added this to the 5.2.0 milestone Aug 7, 2024
@Keboo Keboo added bug release notes Items are likely to be highlighted in the release notes. labels Aug 7, 2024
@Keboo Keboo enabled auto-merge (squash) August 7, 2024 18:18
@Keboo Keboo merged commit 74b3f37 into MaterialDesignInXAML:master Aug 7, 2024
2 checks passed
@Nextra Nextra deleted the popup-dpi branch August 8, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release notes Items are likely to be highlighted in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants