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.
Post Reply
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: 14630
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: 14630
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: 14630
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: 3905
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.

Post Reply