Jump to content
Tom Mueller

Add support for High-DPI gdiScaling

Recommended Posts

Most "older" applications do not have full support of High-DPI scaling. To enhance the appearance of these applications Microsoft added the gdiScaling option in Windows 10 Creators Update (1703) .

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

In the compatibility settings of the windows property dialog of an application this is marked as "System (enhanced)"

Windows.thumb.png.89122163b7bf2aa466722986ef6a764d.png

 

Delphi manifest option do not support this scaling mode at the moment.

Delphi.png

 

Our Build-tool sets the gdiScaling option in the manifest - but a build inside the IDE with gdiScaling is not possible!

I also added a feature request in QP: https://quality.embarcadero.com/browse/RSP-24175.

If you miss this option too - please vote for It.

 

Best regards,

Tom

Edited by Tom Mueller
  • Like 2

Share this post


Link to post

To achieve what you want you can also use custom manifest instead of automatically generated one.

 

Also, your request is a bit confusing - System (Enhanced) scaling in application properties dialog has nothing to do with System Aware setting you can choose for manifest. Auto generated manifest sets only dpiAware and dpiAwareness elements and you want ability to include gdiScaling element.

  • Like 2

Share this post


Link to post
16 hours ago, Dalija Prasnikar said:

To achieve what you want you can also use custom manifest instead of automatically generated one.

Yes, but it would be easier and more logical if it would be an auto generate option.

 

16 hours ago, Dalija Prasnikar said:

Also, your request is a bit confusing - System (Enhanced) scaling in application properties dialog has nothing to do with System Aware setting you can choose for manifest. Auto generated manifest sets only dpiAware and dpiAwareness elements and you want ability to include gdiScaling element.

"System Aware" in Delphi should corresponds to "System" in application properties (<dpiAwareness>system</dpiAwareness>). 

So I named it "System Aware (enhanced)" that should correspond to "System (enhanced)" in application properties (<gdiScaling>true</gdiScaling>)

 

Share this post


Link to post
15 minutes ago, Tom Mueller said:

Yes, but it would be easier and more logical if it would be an auto generate option.

Maybe, but this setting is merely a quick fix for seriously outdated applications. I am not sure how much sense it makes to add such support in IDE.

 

16 minutes ago, Tom Mueller said:

"System Aware" in Delphi should corresponds to "System" in application properties (<dpiAwareness>system</dpiAwareness>). 

So I named it "System Aware (enhanced)" that should correspond to "System (enhanced)" in application properties (<gdiScaling>true</gdiScaling>)

 

Again,  dpiAware and dpiAwareness elements and their values are separate from gdiScaling element and setting that appears in application properties dialog.

 

If I understood you correctly you would like to add gdiScaling element automatically when "System Aware" option is selected, but that might have negative impact on some applications that use such setting. I am saying might because I don't have any particular example where it will fail, but if that setting would be completely compatible, then MS would not introduce additional flag, they would just apply enhanced scaling to all applications with corresponding dpiAware  or dpiAwareness settings.   

Share this post


Link to post
2 hours ago, Dalija Prasnikar said:

Maybe, but this setting is merely a quick fix for seriously outdated applications. I am not sure how much sense it makes to add such support in IDE.

I agree, but what means seriously outdated applications - all MDI applications and Delphi IDE?  😉

 

2 hours ago, Dalija Prasnikar said:

If I understood you correctly you would like to add gdiScaling element automatically when "System Aware" option is selected, but that might have negative impact on some applications that use such setting. I am saying might because I don't have any particular example where it will fail, but if that setting would be completely compatible, then MS would not introduce additional flag, they would just apply enhanced scaling to all applications with corresponding dpiAware  or dpiAwareness settings.

No, it should be an additional item in the DPI awareness drop down box. I called it "System Aware (enhanced)" - but I see it makes it clearer if it is named "GDI Scaling".

Delphis DPI Awareness modes and its Manifest entries would then look like (simplified):

1317141765_Delphi_Manifest_GDIScaling.thumb.jpg.6121eaf9367e8be6eaf9c674d7d737cb.jpg

 

Edited by Tom Mueller
  • Like 3

Share this post


Link to post
5 minutes ago, Tom Mueller said:

I agree, but what means seriously outdated applications - all MDI applications and Delphi IDE?  😉

Well, MDI applications were deprecated a long time ago and Delphi IDE is seriously lagging behind in getting proper high DPI support. What I mean is that actively developed applications should be eventually updated to fully and properly support high dpi and not rely on this fix. I know, it takes time to do so...

 

5 minutes ago, Tom Mueller said:

No, it should be an additional item in the DPI awareness drop down box. I called it "System (enhanced)" - but I see it makes it clearer if it is named "GDI Scaling".

Delphis DPI Awareness modes and its Manifest entries would then look like (simplified):

1317141765_Delphi_Manifest_GDIScaling.thumb.jpg.6121eaf9367e8be6eaf9c674d7d737cb.jpg

 

Now, it is much clearer. Can you please add that picture to your QP report.

Share this post


Link to post
4 minutes ago, Dalija Prasnikar said:

Well, MDI applications were deprecated a long time ago and Delphi IDE is seriously lagging behind in getting proper high DPI support. What I mean is that actively developed applications should be eventually updated to fully and properly support high dpi and not rely on this fix. I know, it takes time to do so...

Yes, I agree - it would be the right way to update all applications to fully support high dpi. For our applications this will take probably 1-2 years and some money that our customers won't spend..

 

9 minutes ago, Dalija Prasnikar said:

Now, it is much clearer. Can you please add that picture to your QP report.

I will do so. Thank you for comments!

Share this post


Link to post
On 4/24/2019 at 9:12 PM, Tom Mueller said:

Delphis DPI Awareness modes and its Manifest entries would then look like (simplified):

1317141765_Delphi_Manifest_GDIScaling.thumb.jpg.6121eaf9367e8be6eaf9c674d7d737cb.jpg

 

This is a very well consolidated table! Care to share the source of the (excel?) file?

Share this post


Link to post
1 hour ago, Edwin Yip said:

This is a very well consolidated table!

Yes it looks nice but the rules that are used by different versions of Windows to determine what DPI awareness and scaling to apply are much more complicated than what that table suggest. Trying to make a UI for editing the manifest has become a game of whac-a-mole.

 

Share this post


Link to post
On 4/24/2019 at 3:35 PM, Dalija Prasnikar said:

MDI applications were deprecated a long time ago

Deprecated by whom? I don't think I've ever seen that claim backed by a first hand source.

I think it's a bit like the claim that circulated about Win32 being deprecated which surfaced when .NET was released. Or about GDI when GDI+ was released.

 

Share this post


Link to post
32 minutes ago, Anders Melander said:

Deprecated by whom? I don't think I've ever seen that claim backed by a first hand source.

I think it's a bit like the claim that circulated about Win32 being deprecated which surfaced when .NET was released. Or about GDI when GDI+ was released.

 

Multiple Document Interface - Win32 apps | Microsoft Docs

 

Quote

Many new and intermediate users find it difficult to learn to use MDI applications. Therefore, you should consider other models for your user interface. However, you can use MDI for applications which do not easily fit into an existing model.

 

In practice we can see that MS have not updated MDI for a very long time. The window chrome for MDI child windows does not match the latest style.

 

I mean, this is MS, it's not going away any time soon.

  • Like 1

Share this post


Link to post
41 minutes ago, Anders Melander said:

Deprecated by whom? I don't think I've ever seen that claim backed by a first hand source.

I think it's a bit like the claim that circulated about Win32 being deprecated which surfaced when .NET was released. Or about GDI when GDI+ was released.

 

In addition to what @David Heffernan said

 

https://docs.microsoft.com/en-us/cpp/mfc/sdi-and-mdi?view=msvc-160

 

Quote

Under Windows 95 and later, applications are commonly SDI because the operating system has adopted a "document-centered" view.

 

Share this post


Link to post
2 minutes ago, David Heffernan said:

 

Quote

Many new and intermediate users find it difficult to learn to use MDI applications. Therefore, you should consider other models for your user interface. However, you can use MDI for applications which do not easily fit into an existing model.

In practice we can see that MS have not updated MDI for a very long time. The window chrome for MDI child windows does not match the latest style.

Yes I'm aware that it's not recommended and of the limitations. My point was that claiming that it's deprecated is just FUD aimed at driving developers towards alternatives such as SDI.

 

Ironically my experience with replacing MDI with SDI is that the users often find SDI confusing. They feel safe with MDI because they know where their windows are - they're always inside the MDI parent. I've tried with docked windows as a middle ground but that is far too advanced for some users.

Share this post


Link to post
48 minutes ago, Anders Melander said:

Yes I'm aware that it's not recommended and of the limitations. My point was that claiming that it's deprecated is just FUD aimed at driving developers towards alternatives such as SDI.

You can call it whatever you like, but if the fact that MS didn't bother to update MDI window style to match their latest (now 5 years old) Windows 10 OS does not qualify as being deprecated, then I don't know what deprecated is. Also MS is spreading that FUD for the last 25 years...

  • Like 1

Share this post


Link to post
1 hour ago, Dalija Prasnikar said:

You can call it whatever you like, but if the fact that MS didn't bother to update MDI window style to match their latest (now 5 years old) Windows 10 OS does not qualify as being deprecated, then I don't know what deprecated is. Also MS is spreading that FUD for the last 25 years...

Not being a native English speaker I just looked up what "deprecated" actually means and it turns out that it's just what you describe: Discouragement of use. My bad.

Edited by Anders Melander
native English vs English native - oh dear
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×