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.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
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:59 pm

Are you sure this is related to DPI Awareness PMv2? I know nothing about OpenGL but when running the pyramid sample:

I built wxWidgets master with MSVC 2019 using provided CMakefiles with "per monitor" DPI awareness. Log from the pyramid sample reads

Code: Select all

21:56:43: The display supports required visual attributes.
21:56:43: Couldn't create OpenGL context
21:56:43: Trying to set OpenGL 99.2 failed, as expected.
21:56:43: OpenGL Core Profile 3.2 successfully set.
and the About box also reports 3.2
pyramid.png
pyramid.png (12.09 KiB) Viewed 189 times
Is this version something different than what you meant?

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 8:10 pm

I built my app's rc file with -DwxUSE_DPI_AWARE_MANIFEST=0 and OpenGL works as normal. Then I change that to -DwxUSE_DPI_AWARE_MANIFEST=2, which adds amd64_dpi_aware_pmv2.manifest, and re-link and run it in Win10 at normal dpi and I get OpenGL 1.1. This might be driver related, I have Intel HD 3000 which supports only non-core profile gl3. Also, in wine I still get gl 2.1 for another machine.

I would need to verify this with one of the opengl samples so I won't leave an issue unless I do that.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
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 8:39 pm

FWIW, I did the same I described in my previous post but with mingw-w64 (i686-8.1.0-win32-sjlj-rt_v6-rev0), still get OpenGL 3.2.

Also, as you probably know, unlike the "old" manifest which just declares support for Common Controls v6, the DPI aware manifests declare more then just DPI Awareness support: they also have Windows version compatibility statements. It seems the issue may not be within wxWidgets, see e.g. this (quite old but perhaps still relevant) https://stackoverflow.com/questions/346 ... s-opengl-2

Copy the manifest, remove

Code: Select all

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!-- Windows Vista -->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
      <!-- Windows 7 -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
      <!-- Windows 8 -->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
      <!-- Windows 8.1 -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
      <!-- Windows 10 -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
    </application>
</compatibility>
use the modified manifest and see if it helps.

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 9:15 pm

That solved that issue. Based on the link you provided, the cause is likely Intel's gpu driver.

Everything looked right out of the box at HiDPI at the first glance.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
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 9:29 pm

Well, so we know that the issue is not with wxWidgets OpenGL code.

So, now you "only" have to find some workaround for the bug, removing the declaration is not the solution.

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 » Thu Apr 23, 2020 3:31 pm

Why isn't deleting that compatibility section a viable workaround? Intel doesn't seem to support its HD3000 chip in Windows 10 so no fix is going to come from there.

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

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

Post by PB » Thu Apr 23, 2020 4:41 pm

Well, it may "fix" your issue, but those declarations are there for a reason. Having or not having them makes documented differences in how some Windows API behave (hence the bug you ran into).

But if you believe your application is not affected and do not want to spend time and effort on proper workaround (assuming there is any), I guess it's OK.

Post Reply