I had a look at the KDE bug report. Why has its status been set to “RESOLVED UPSTREAM”? IMHO, it isn’t resolved yet. Setting the environment variable QT_USE_PHYSICAL_DPI
is an workaround for a specific case, but does not solve all issues. In particular, it relies on the EDID of the monitor to be correct.
IMHO, there are two (maybe three) settings which are necessary and they all have existed in old X11:
- The screen manager/server must correctly report the actual physical DPI of the monitor to the application. Currently, the screen always reports 96dpi. In case of broken EDIDs, there must be an user option to override the DPI value.
- The screen manager/server should provide a global scaling factor for GUI elements. (We already have this one today.) The initial default value may be derived from the monitors DPI normalized to 96dpi.
- Optionally, the screen manager/server may provide an option to override the DPI setting for fonts with a different value.
Please note, that the settings 1 and 2 serve two different purposes and hence these options should clearly be kept distinct.
Applications should use setting 1 (the DPI value) to correctly scale the objects displayed in their “workbench”. I use the term “workbench” for that part of an application which displays or manipulates objects of the real physical world. (Note, not every application has a “workbench”).
Applications should use setting 2 (the scaling factor) to scale their GUI elements (but not the representation of any actual physical object). The scaling factor is merely a mean to keep the GUI usable on high-resolution screens or as an aid for people with impaired eyesight.
I understand that it was the initial idea of the KDE developers to only have a single setting for both purposes. This means the idea was to exploit the global GUI scaling and set the scaling factor such that it corresponds to the actual, physical DPI value normalized to 96dpi. However, this a) does not work and b) should only be used for the purpose of GUI scaling.
Option 1: Physical DPI value
For all applications which have some kind of “workbench” which displays or manipulates objects of the real world it is absolutely paramount to know the correct DPI such that they can scale objects according to their correct physical size. (Software of this kind is e.g. LibreOffice or Inkscape which show some kind of “canvas” representing physical sheets of paper, any kind of CAD/CAE software like QCad, FreeCAD, etc.)
I have a 311mm × 175mm laptop panel (14" diagonal) with 2560 × 1440 pixels, i.e. a resolution of 209 dpi. Even if I set the global scaling factor to 209÷96 = 2,177 ≅ 215%, the program xdpyinfo | egrep resolution
still reports the default pixel density of 96dpi. If the original idea was indeed to exploit the global scaling factor to correct for higher DPI, then that output should not be 96dpi but 206dpi. In particular, applications which are not KDE native, get the scaling of their workbench wrong. (GIMP is an example.)
Moreover, the scaling option only allows to set values in steps of 5%. This is to imprecise to get a correct scaling for “large” physical objects. There must also be an option to set DPI values like 209dpi or 94dpi.
Option 2: GUI Scaling factor
The scaling factor should merely be a mean to adopt the size of the GUI elements, but should no affect the scaling of the “workbench”.
If I set the scaling factor to 215% (as it would be “correct” for 209dpi on my 311mm × 175mm and 2560px × 1440px laptop panel), then the window decorations become so large that no space is basically left for the actual application. Personally, I have rather good eyesight and I like to have the GUI elements be scaled at only 120% (not 215%), because this provides me with more space for the actual application. On the contrary, someone with impaired eye sight might like to have 150% scaling even for 94dpi on a 520mm × 325mm and 1920px × 1200px monitor.
But as being said, in both cases the scaling of the applications “workbench” should be unaffected by that.
I am unsure whether a GUI scaling factor is strictly necessary. There is always also the option to adjust the GUI theme in the first place. But I admit that a global scaling factor is convenient. Nonetheless, an icon which has initially be designed at 24px always looks better than an icon designed at 16px and scaled up to 24px after-the-fact. Same holds for a menu bar which looks better if immediately rendered at 48px instead of 32px and then scaled up.
Option 3: Font DPI setting
I am indifferent wrt. to the third point. I believe it is not really necessary, even though I used that setting in the past myself. Actually, this option should be superfluous and already be covered by the scaling GUI factor. I only used it in the past, because with X11 the GUI fonts were scaled according to the physical DPI value (i.e option 1) and remained unaffected by the GUI scaling factor (option 2).