aspia icon indicating copy to clipboard operation
aspia copied to clipboard

Client/Console is overscaled on high DPI

Open CaptainFlint opened this issue 3 years ago • 4 comments

Windows 10, DPI is set to 150%. When I start Aspia client or console (have not checked other components), the UI is scaled too much, looks like 200% or so.

Here are some screenshots.

  1. How Console looks with normal 100% scaling. console-dpi-100
  2. The previous image streched to 150% in an image editor, as an illustration of what I would expect to see. console-dpi-100-to-150
  3. What Console actually looks like when Windows DPI is set to 150%. console-dpi-150

You can see that the window titlebar is approximately the same in the 3rd and the 2nd images. It means, that OS shows the system window areas scaled to 150%, just as expected. However, the internal client area elements (fonts, icons, etc.) are way too big in the 3rd image.

I have not looked at the code, but is it possible that, for example, Qt already takes care of all the scaling, and you then add your own scaling on top of that?

OS: Windows 10 x64 1909 Aspia 2.4.0.

CaptainFlint avatar May 11 '22 23:05 CaptainFlint

All scaling is handled by Qt. Aspia does not control it.

dchapyshev avatar May 11 '22 23:05 dchapyshev

I have other Qt applications, and they don't do such an over-scaling, but show elements with normal 150% size, as expected.

CaptainFlint avatar May 11 '22 23:05 CaptainFlint

I googled a bit, and it seems the issue with Qt scaling by 200% when Windows is set at 150% is a known behavior, it just rounds it to the nearest integer which is 2 (200%). To avoid this, it's recommended to use QGuiApplication::highDpiScaleFactorRoundingPolicy with policy set to PassThrough.

I tried overriding the policy using environment variable QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough, and, indeed, the scale became consistent with the OS.

Although there is another issue which, I guess, has to be treated with custom code. When I connect to remote host, and choose Automatic window size, it's calculated pre-scaled (that is, 200% of the real host screen size when started normally, or 150% size when run with QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough). My guess is, screen size is probably calculated using the same virtual pixel units as the rest of the UI, and therefore has the same scale. But in this case pixels should be mapped directly into pixels, without scaling.

CaptainFlint avatar May 12 '22 23:05 CaptainFlint

Thanks for your research into the problem. I will try to take this into account in the next release.

dchapyshev avatar May 13 '22 17:05 dchapyshev

Fixed in 2.5.0 version.

dchapyshev avatar Dec 24 '22 21:12 dchapyshev

Fixed in 2.5.0 version. no, it's already exists As a comparison,set system environment variables Qt_ENABLE_HIGHDPI_SCALING=0 and QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough,it's not overscaled image

940842546 avatar Jan 09 '23 03:01 940842546

In the original problem, it was described that the application looks larger than other applications on the system. This issue has been fixed and now the app size looks the same as other apps. When you set the Qt_ENABLE_HIGHDPI_SCALING parameter to 0, the application completely stops adjusting to the DPI in the system. This is incorrect behavior. The application must be able to scale according to the DPI. Moreover, in Qt 6, the Qt_ENABLE_HIGHDPI_SCALING parameter is declared obsolete and scaling is always enabled. High DPI scaling disabled: high_dpi_scaling_false High DPI scaling enabled: high_dpi_scaling_true

dchapyshev avatar Jan 09 '23 11:01 dchapyshev

In the original problem, it was described that the application looks larger than other applications on the system. This issue has been fixed and now the app size looks the same as other apps. When you set the Qt_ENABLE_HIGHDPI_SCALING parameter to 0, the application completely stops adjusting to the DPI in the system. This is incorrect behavior. The application must be able to scale according to the DPI. Moreover, in Qt 6, the Qt_ENABLE_HIGHDPI_SCALING parameter is declared obsolete and scaling is always enabled. High DPI scaling disabled: high_dpi_scaling_false High DPI scaling enabled: high_dpi_scaling_true

nono i mean the display the display is overscale this is the compare with teamviewer image

940842546 avatar Jan 13 '23 10:01 940842546