Windows High DPI resolution

58 views
Skip to first unread message

Thomas Goering

unread,
Mar 13, 2024, 1:55:11 PMMar 13
to Eiffel Users
I installed EiffelStudio 23.09 on my Mac (Apple silicon) in a Parallels virtual machine with Windows 11 on Arm. I use an external 4K display on my Mac and I left all the graphics settings unchanged (in Parallels the setting is called: Optimal for retina displays).

1. With this default setting the splash screen is displayed very small during startup of EiffelStudio and some icons (for Auto Hide, Minimize, Maximize and Close) are pretty small. In the about dialog it says: Monitor DPI = 192
See screenshot DPI192.png

2. When I change the properties of the EiffelStudio executable (or shortcut) in this way: Open the properties dialog and select "Compatibility" tab, then choose button "Change High DPI settings" and in this dialog switch on both options and select "System (extended)" (I use a German Windows installation, so sorry if the translations are not accurate) from the dropdown list below the second option. With these settings the splash screen is displayed larger than before and all icons have the same size. In the about dialog it now says: Monitor DPI = 96
See screenshot DPI96.png

I personally prefer the first option because the icons look brighter and crisper, but some icons are smaller and the splash screen is too small.

As far as I remember this hasn't changed since EiffelStudio can somehow handle high DPI. Will this be improved or what is the expected behavior (or setting)?

Thanks,
Thomas
DPI96.png
DPI192.png

Thomas Beale

unread,
Mar 13, 2024, 7:39:24 PMMar 13
to Eiffel Users
Even on a native Windows machine (current model Dell XPS15) with a 1920x built-in FHD screen, and a second monitor 3840x or similar, ES is unusable on the second monitor, but the icon sizes even on the primary are microscopic.

Thomas Beale

unread,
Jun 27, 2024, 9:12:37 PM (11 days ago) Jun 27
to Eiffel Users
I just discovered that if you compile an Eiffel visual application (at least mine) with mingw, it will display with stable font size on both primary and secondary monitors, which have greatly different resolution.
But if I recompile with msc_vc140 compiler setting, the font size / icon sizes etc on the large hires monitor are microscopic, i.e. there is no scaling going on.
No other changes in the software.

Is there an EiffelVision or other setting that enables this to be controlled?

Thomas Goering

unread,
Jun 28, 2024, 10:07:57 AM (10 days ago) Jun 28
to Eiffel Users
We discussed this recently, didn't we?


I tried with a Vision2 example and can confirm it, although I had to change my Parallels setting from "Scaled" to "Best for retina display" to see the difference between the two different compilers.

It's probably a good idea to create a support report for Eiffel Software.

Thomas

Thomas Goering

unread,
Jun 30, 2024, 6:51:34 AM (9 days ago) Jun 30
to Eiffel Users
> Is there an EiffelVision or other setting that enables this to be controlled?

I doubt there is:

In class WEL_SCALING_EXTERNALS there is some DPI-related code that is only executed when compiled with the Microsoft compiler. This check was introduced in 2019 and it looks like it disables High DPI support "to avoid issues with Mingw":

https://github.com/EiffelSoftware/libraries/commit/41edae8ac72d918b3ea8fbcf37a5e4e5c5991e1b


The check "#ifdef _MSC_VER" is still there (though slightly different today).


I did not yet fully debug and checked if this is the only and important difference between Microsoft and Mingw compiler. But if so then:


1. What were the issues with Mingw?

2. Could some setting be introduced to switch on/off High-DPI handling for Microsoft compiler to get at least the same results than with Mingw?


Thomas


Thomas Goering

unread,
Jun 30, 2024, 2:12:05 PM (8 days ago) Jun 30
to Eiffel Users
I'm pretty sure I can confirm the following:

1. The issue with Mingw was a missing include file (shellscalingapi.h) from a Windows API needed for High DPI. BTW: The Mingw compiler that is delivered with EiffelStudio 24.05 seems to be from 2010!
Maybe a newer version includes support for this Windows API and probably also fixes (e.g. security related)?

2. Changing the above mentioned #ifdef statement in a way that compiling with the Microsoft compiler creates the same code that Mingw creates also results in the same UI as with Mingw. I compiled EiffelStudio with this change and it then looks much better in a High DPI resolution. Its About dialog reports Monitor DPI = 96. See DPI96.png screenshot from my first post.
This also means that a setting could be introduced to switch on/off High-DPI handling for Microsoft compiler (e.g. with an environment variables).

Thomas Beale, if you want to try it yourself: Change all five occurrences of _MSC_VER with something different (e.g. _MSC_VER_) in class WEL_SCALING_EXTERNALS (from the WEL library), recompile your application and its UI should always look the same (compiled with Microsoft or Mingw compiler).

I will look deeper into this because I'm very interested in UI related issues. But maybe group eiffelstudio-dev is a better place for more technical discussions about this topic so I will move there if I have more results.

Thomas

wolandscat

unread,
Jun 30, 2024, 2:37:21 PM (8 days ago) Jun 30
to eiffel...@googlegroups.com
Thomas,

thanks for your through investigation. I will try the changes and see
what happens.

thomas
Reply all
Reply to author
Forward
0 new messages