opensmalltalk-vm icon indicating copy to clipboard operation
opensmalltalk-vm copied to clipboard

High-DPI window decorations

Open LinqLover opened this issue 2 years ago • 5 comments

In the Squeak bundles, the executables for Windows now contain a manifest file to make sure the image contents are not displayed blurry on high-DPI screens but we can use the image-side scaling mechanism instead. However, the VM does not scale up the window decorations properly even though this is promised by the manifest file:

100% DPI: image

250% DPI: image

LinqLover avatar Jan 14 '22 19:01 LinqLover

Have you tried to override the settings of the executable? On my machine the window decorations are scaled properly. It is nothing the VM itself can fix. In the Manifest, there are several levels of dpi-awareness, which also affect the scaling of the windows decorations.

Read more about this here: https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows?redirectedfrom=MSDN

In the app bundle, we use the following configuration in the Manifest:

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

To support both Windows 10 (Update 1703) and prior versions.

.... maybe this is related to the default-manifest.o bug, which prevents 32-bit builds to even consider the .manifest file at all.

marceltaeumel avatar Jan 17 '22 11:01 marceltaeumel

I am using OSVM 202112201228. I keep observing the issue when changing the scaling factor under Windows, for instance, when moving a window from a normal screen to a high-DPI screen. As a wild guess, should the VM handle the WM_DPICHANGED event?

LinqLover avatar Feb 15 '22 16:02 LinqLover

Can you reproduce this? :)

LinqLover avatar Feb 15 '22 16:02 LinqLover

Here is a possibly related observation:

  • open Squeak on a high-DPI screen (so that everything will look tiny unless you change the image-side scale factor)
  • move the window to a low-DPI screen
  • now all mouse cursor looks very tiny. The image-side rendered cursor (as can be seen when dragging a morph) looks correct, though.

This effect occurs the other way around, too, when starting the window on a low-DPI screen and moving it to a high-DPI screen. Maybe the cursors should always be rendered with respect to the operating system's scale factor?

LinqLover avatar Feb 16 '22 20:02 LinqLover

Have you tried to override the settings of the executable?

Using OSVM 202112201228, this seems to be necessary, otherwise, the OS scales up the contents on the high-DPI screen. Did you change this after November? :-)

LinqLover avatar Feb 23 '22 19:02 LinqLover