DPI-awareness workaround is used instead of proper manifest declaration

Post any bugs here that you experience with running GRIP.

Please USE OUR BUG REPORTING TEMPLATE, or your thread might be reformatted or removed.
MT_
Posts: 11
Joined: Sun Mar 18, 2018 8:35 pm

DPI-awareness workaround is used instead of proper manifest declaration

Postby MT_ » Sat Mar 31, 2018 1:03 pm

Summary

For enabling DPI awareness, the GRIP game wrongly uses a registry-based workaround instead of proper manifest declaration.

Such workaround is solely intended for OLD applications and should NOT be used for new applications written by developers aware of DPI awareness.

Any workaround may eventually stop to work, while the proper solution will work as expected. Moreover, adding manifest declaration is simpler than adding the workaround.

Wrong approach — workaround

The workaround is intended for old applications which authors were not aware of DPI awareness itself. The workaround works by overriding application’s DPI awareness by adding a Windows-registry parameter which name is the path to executable and the value is `HIGHDPIAWARE`:

Code: Select all

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers


But when writing new applications which developers are aware of DPI awareness, using the workaround does not make sense. Just declare DPI awareness instead of overriding it. Needless to say, declaring DPI awareness is much simpler than dealing with Windows registry.

Proper solution — manifest declaration

The proper approach is to put a simple DPI-awareness declaration into the application’s manifest. This can be enabled in Visual Studio 2017 project settings:

Configuration Properties → Manifest Tool → Input and Output → DPI Awareness → High DPI Aware.


Or the manifest should be edited manually:

1. The `assembly` element of the manifest must have the ` xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"` attribute.

2. The `assembly` element must contain the following `asmv3:application` element (besides other needed elements, not instead):

Code: Select all

<asmv3:application>
   <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
   </asmv3:windowsSettings>
</asmv3:application>


That’s all. Thanks.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests

cron