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

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Stepan Hrbek
Knows some wx things
Knows some wx things
Posts: 31
Joined: Wed Mar 11, 2009 11:03 pm

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

Post by Stepan Hrbek » Sun Dec 29, 2019 12:39 pm

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

Stepan Hrbek
Knows some wx things
Knows some wx things
Posts: 31
Joined: Wed Mar 11, 2009 11:03 pm

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

Post by Stepan Hrbek » Sun Dec 29, 2019 12:56 pm

App also needs to declare DPI awareness in manifest, I did that.

User avatar
doublemax
Moderator
Moderator
Posts: 14888
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Sun Dec 29, 2019 1:04 pm

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.
Use the source, Luke!

Stepan Hrbek
Knows some wx things
Knows some wx things
Posts: 31
Joined: Wed Mar 11, 2009 11:03 pm

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

Post by Stepan Hrbek » 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.

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.

User avatar
doublemax
Moderator
Moderator
Posts: 14888
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Sun Dec 29, 2019 2:24 pm

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.
Use the source, Luke!

Stepan Hrbek
Knows some wx things
Knows some wx things
Posts: 31
Joined: Wed Mar 11, 2009 11:03 pm

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

Post by Stepan Hrbek » Sun Dec 29, 2019 3:17 pm

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]
Attachments
wx2.png
wx1.png

User avatar
doublemax
Moderator
Moderator
Posts: 14888
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Sun Dec 29, 2019 3:26 pm

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.
Use the source, Luke!

Stepan Hrbek
Knows some wx things
Knows some wx things
Posts: 31
Joined: Wed Mar 11, 2009 11:03 pm

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

Post by Stepan Hrbek » Sun Dec 29, 2019 3:41 pm

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

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4168
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Post by ONEEYEMAN » Mon Dec 30, 2019 4:41 pm

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.

thoray
Knows some wx things
Knows some wx things
Posts: 42
Joined: Sun Oct 18, 2015 9:31 am

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

Post by thoray » Wed Apr 22, 2020 3:02 pm

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.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4168
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Post by ONEEYEMAN » Wed Apr 22, 2020 3:25 pm

Hi,
Is your application "DPI Aware"? Meaning you turn this option "ON" inside the manifest...

Thank you.

thoray
Knows some wx things
Knows some wx things
Posts: 42
Joined: Sun Oct 18, 2015 9:31 am

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

Post by thoray » Wed Apr 22, 2020 3:46 pm

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).

thoray
Knows some wx things
Knows some wx things
Posts: 42
Joined: Sun Oct 18, 2015 9:31 am

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

Post by thoray » Wed Apr 22, 2020 6:59 pm

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.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2431
Joined: Sun Jan 03, 2010 5:45 pm

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

Post by PB » Wed Apr 22, 2020 7:09 pm

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

thoray
Knows some wx things
Knows some wx things
Posts: 42
Joined: Sun Oct 18, 2015 9:31 am

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

Post by thoray » Wed Apr 22, 2020 7:16 pm

And I can add to those that with HiDPI manifest enabled OpenGL reports as version 1.1, which is likely Windows software renderer.

Post Reply