Skip to content
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

WinForms DPI scaling will look blurry for most users #2135

Closed
mhsmith opened this issue Sep 25, 2023 · 1 comment · May be fixed by #2155
Closed

WinForms DPI scaling will look blurry for most users #2135

mhsmith opened this issue Sep 25, 2023 · 1 comment · May be fixed by #2155
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@mhsmith
Copy link
Member

mhsmith commented Sep 25, 2023

This area was last touched in #717, which added a call to SetProcessDpiAwarenessContext(-2). -2 is defined as:

DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
System DPI aware. This window does not scale for DPI changes. It will query for the DPI once and use that value for the lifetime of the process. If the DPI changes, the process will not adjust to the new DPI value. It will be automatically scaled up or down by the system when the DPI changes from the system value.

That sounds reasonable, but on Windows 10 22H2 the setting that I assume corresponds to the "system value" is hidden behind "Advanced scaling settings" and is marked "not recommended". This is the setting I used to use myself (having originally set it when the machine was on Windows 7), and it does work correctly with Toga, though you need to log out and log in again to change it.

However, the per-monitor scaling settings are much more prominent, and more convenient since they don't require logging out. So most users will use those settings and leave the "system value" at 100%. And this causes Toga apps to appear blurry, as shown in #704.

So we should probably switch to DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE or DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, and do whatever's necessary to keep our internal idea of the DPI up to date.

@mhsmith mhsmith added bug A crash or error in behavior. windows The issue relates to Microsoft Windows support. labels Sep 25, 2023
@mhsmith mhsmith changed the title WinForms DPI scaling won't work for most users WinForms DPI scaling will look blurry for most users Sep 25, 2023
@mhsmith
Copy link
Member Author

mhsmith commented Nov 8, 2023

Duplicate of #1004.

@mhsmith mhsmith closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant