Page 1 of 2

HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 12:39 pm
by Stepan Hrbek
Hello,

I have no previous experience with HiDPI support, so when I tested HiDPI with wxWidgets, I had no idea what specific actions I need to take. Fortunately it works nearly out of the box. After rebuilding wxWidgets from git head and rebuilding my dialogs with the most recent version of wxFormBuilder, I only had to change all dialog sizes to -1,-1 and then check "Let Windows try to fix apps so they're not blurry" in Windows 10 settings to make HiDPI work. It's great.

I still wonder, why is that Win10 setting necessary? Or am I doing it wrong?

Stepan

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 12:56 pm
by Stepan Hrbek
App also needs to declare DPI awareness in manifest, I did that.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 1:04 pm
by doublemax
I don't use formbuilder, so i don't know what ""Let Windows try to fix apps so they're not blurry" does. I assumed that it just sets the "DPI aware" flag in the manifest.

But if you don't use absolute sizes/positioning or custom drawing in your application, this is all you need to do.

You should also use the latest version from GIT, HiDPI support is still being worked on.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 2:16 pm
by Stepan Hrbek
"Let Windows try to fix apps so they're not blurry" is Win10 checkbox, it's in Settings / Display / Advanced scaling settings.

If I don't check it, there is no blur, but only about 50% of GUI elements are scaled properly (e.g. text in wxPropertyGrid is scaled, text in wxTreeCtrl is unscaled).

If I check it, there is still no blur and all GUI elements except wxAUI pane titles are scaled properly.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 2:24 pm
by doublemax
Stepan Hrbek wrote:
Sun Dec 29, 2019 2:16 pm
"Let Windows try to fix apps so they're not blurry" is Win10 checkbox, it's in Settings / Display / Advanced scaling settings.
Interesting, i didn't know that.

I don't know what it does under the hood, but ideally an application should look right without it.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 3:17 pm
by Stepan Hrbek
First image shows AUI sample with default win10 settings, scaling of text in top right pane is wrong.
[attachment=0]wx2.png[/attachment]

Second image shows good scaling when Win10 "fix apps" is checked.
[attachment=1]wx1.png[/attachment]

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 3:26 pm
by doublemax
As the Windows dialog in the background is scaled too, are these screenshots made with different scaling values?

Are you using the latest wxWidgets version from GIT? If not, please redo the test with that version.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Sun Dec 29, 2019 3:41 pm
by Stepan Hrbek
Both is with 200% scaling.
Code is fresh from git today (38cec22d4c5ff591964dc1d36f62189a3d238eec)
It does not look trivial anymore, so I created ticket https://trac.wxwidgets.org/ticket/18642

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Mon Dec 30, 2019 4:41 pm
by ONEEYEMAN
Hi,
As Vadim wrote recently on the wx-users ML, using this checkbox shuoldn't be necessary.
However as doublemax pointed out - HiDPI is still WIP. Some stuff in the library is still not DPI aware - namely wxAUI, possibly wxGrid and some other controls.

Thank you.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Wed Apr 22, 2020 3:02 pm
by thoray
I tried my wx app in Win10 set to scaling factor 125% and title bar font is sharp but everything below that is scaled.

Is there something I need to do to enable HiDPI support? This with the latest wx git master.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Wed Apr 22, 2020 3:25 pm
by ONEEYEMAN
Hi,
Is your application "DPI Aware"? Meaning you turn this option "ON" inside the manifest...

Thank you.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Wed Apr 22, 2020 3:46 pm
by thoray
I haven't enabled anything related specifically. I've no idea what a manifest is or how to enable HiDPI in it. From what I gathered wx should do this automatically now by default since wxUSE_DPI_AWARE_MANIFEST defaults to 2 (use per monitor settings).

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Wed Apr 22, 2020 6:59 pm
by thoray
HiDPI now working after adding: '-DwxUSE_DPI_AWARE_MANIFEST=2' when compiling my project's Windows .rc file with Mingw's windres and copying in 'include/wx/msw/amd64_dpi_aware_pmv2.manifest' from wxWidgets distribution to 'include/wx/msw' at wx install prefix location.

Maybe HiDPI can be enabled somehow when compiling wx to avoid this?

Note, I didn't have to check or found any "fix apps so they're not blurry" setting in Win10.

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Wed Apr 22, 2020 7:09 pm
by PB
BTW, Per Monitor DPI Awareness in wxWidgets is still work in progress and there issues, see e.g. here for some reported ones
https://trac.wxwidgets.org/ticket/18474

Re: HiDPI in Win10 and "fix apps so they're not blurry"

Posted: Wed Apr 22, 2020 7:16 pm
by thoray
And I can add to those that with HiDPI manifest enabled OpenGL reports as version 1.1, which is likely Windows software renderer.