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 »

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 »

App also needs to declare DPI awareness in manifest, I did that.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
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 »

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 »

"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: 19114
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 »

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 »

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: 19114
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 »

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 »

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: 7458
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 »

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: 48
Joined: Sun Oct 18, 2015 9:31 am

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

Post 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.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
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 »

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: 48
Joined: Sun Oct 18, 2015 9:31 am

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

Post 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).
thoray
Knows some wx things
Knows some wx things
Posts: 48
Joined: Sun Oct 18, 2015 9:31 am

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

Post 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.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

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

Post 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
thoray
Knows some wx things
Knows some wx things
Posts: 48
Joined: Sun Oct 18, 2015 9:31 am

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

Post 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.
Post Reply