Chocolateygui: Support per-monitor DPI

Created on 1 Apr 2021  路  10Comments  路  Source: chocolatey/ChocolateyGUI

High-DPI displays are getting common each passing day. However, many users like me still own Low-DPI screens and use them in combination with newer High-DPI monitors. My laptop has a 1080p display and I connect it to a 4K display with 125% scaling. This causes the embedded display to be rendered 96 DPI while the 4K display to be rendered in 120 DPI.

Windows 10 has an API to support multiple displays with different DPI values (https://github.com/microsoft/WPF-Samples/tree/master/PerMonitorDPI). For applications that doesn't support this API, Windows scales the window by stretching the rendered raster of the window. Currently, Chocolatey GUI is rendered blurry if I move the window to my 4K display. Implementing per-monitor DPI support for Chocolatey GUI would provide a better user experience overall.

Improvement

All 10 comments

@ongun-kanat thanks for raising this issue!

@punker76 is this something that MahApps can help with?

@gep13 We can do this by targeting the Gui to v4.6.2 .Net Framework.

@punker76 ah, gotcha. Ok, let me get back to you on that one 馃槃

@punker76 we have discussed this internally, and we have decided that we can move forward with changing the target .NET Framework version. Related issue has been created here: https://github.com/chocolatey/ChocolateyGUI/issues/841

Once we change the .NET Framework version, what else is needed from a MahApps perspective to enable high DPI support?

@gep13 Just use highest target for MahApps (4.7) and add an app.manifest like this one

These settings are the relevant ones

https://github.com/MahApps/MahApps.Metro.IconPacks/blob/a24bc41dddd8c896949e6f6d01512ffbb14bed94/src/MahApps.Metro.IconPacks.Browser/app.manifest#L34-L42

@ongun-kanat I have just made a commit into the repository that adds in the changes to the app.manifest that @punker76 suggested. This will result in a new package being pushed to our MyGet feed as a pre-release package.

Would you be willing to take this for a spin to confirm that it is now working as expected?

If so, you should be able to install the pre-release package using the following command:

choco upgrade chocolateygui --pre --version 0.19.0-alpha0169 --source https://www.myget.org/F/chocolateygui/

Please let us know if you have any problems/questions.

@gep13 Works on my machine TM (125 %)

image

@punker76 sweet! Will wait for @ongun-kanat to confirm, and then we can close out this issue.

It works great! Thank you very much!

100% - 1080p

chocolatey-gui-100

125% - 4K

chocolatey-gui-125

Install screen in 125%

install-125

That is great! Thanks for confirming!

Was this page helpful?
0 / 5 - 0 ratings