Quote Originally Posted by Jonax View Post
It turned out it's possible and useful for some windows users to scale the monitor, e.g. to 125%. Since I hadn't taken that into account the optics turned out horrible.

See below screenshot at 125% on Windows.
This is not Monitor scaling but UI scaling. You see on Windows all UI elements size is defined in pixels including the Font size. So when you launch an application on a monitor that has the same physical size but higher resolution all UI elements in your application will end up being much smaller since their size s defined by hardware pixels.
So you need to retrieve information of how many pixels per inch does the monitor have (DPI resolution) in order to be able to calculate the ratio from the DPI resolution your UI was designed on and to the current DPI resolution of your monitor. Now this probably doesn't seem to difficult right?
Well the problem is that Microsoft made this a bit more difficult by requiring the application to be High DPI aware for the Windows to report actual monitor DPI and not default 96 DPI resolution as it does to all application that does not support High DPI awareness.Not to mention that Windows by itself support four DPI awareness Modes. Or the fact that some of them doesn't scale properly in certain conditions especially on systems with multiple monitors. Or the fact that Windows will go and cale some standard controls (controls that are not rendered by VCL or FMX in Delphi or LCL in Lazarus but are instead wrappers for standard Windows controls that are rendered by Windows itself) that your application might be using automatically but you need to scale rest of the controls yourself.

Now I'm not sure of how to deal with High DPI awareness in Lazarus so I recommend you check the Lazarus forums for this.

Quote Originally Posted by Jonax View Post
I assume the same thing could happen to Linux.
Now I'm not sure how Linux deals with DPI scaling but so far I have never heard users on Linux having so much problems as they do on Windows. So I'm guessing that DPI scaling on Linux might have more stable implementation than the one on Windows.

Quote Originally Posted by Jonax View Post
How common is the scaling?
Until the arrival of High DPI monitors like 4K monitors DPI scaling was pretty rarely used since it was used only as accessibility feature for visually impaired people. But with the arrival of High resolution monitors this became much more commonly used due to the above mentioned problem of Windows Ui elements size being defined in the number of hardware pixels.
MacOS solved this a long ago by using Virtual pixels for defining the size of any control. Then the OS performs the needed scaling so that such control has the same actual size (like 2,5 cm width) any any apple device regardless of Screen size or screen resolution of that device.