Mailinglist Archive: opensuse-factory (368 mails)

< Previous Next >
[opensuse-factory] Upcoming changes to HiDPI scaling in Qt
Hi,

tl;dr section at the bottom.

During Leap 15.0 development, a focus was on the experience with HiDPI
(>96 pixels per inch) monitors.

Some bugs got reported which indicated that there were some issues especially
in mixed-DPI environments. While they generally work fine after some
(extensive) manual configuration, the automatic configuration wasn't quite
that good. Fixing this will also improve the experience during the installation
(no manual configuration possible) and on desktops which don't have a UI to
configure it.

X was not designed for HiDPI and especially not
mixed-DPI environments. It has only a single dpi specifier for the whole screen
(spanning all monitors) and it is on all drivers, except the proprietary Nvidia
driver, 96x96dpi. Each monitor geometry is available via XRandR though.

Now Qt comes into play: It uses the screen DPI (so 96dpi) as global DPI and
applies per-monitor scale factors on top. There is a font scale factor which
is computed by (screen DPI)/(primary monitor DPI).
If your primary monitor has 96dpi and your secondary 192dpi, it results in a
1x font scale and 1x/2x scale factors, as expected.
If you set the 192dpi monitor as primary though, it gets ugly: The font scale
is now 96/192 = 0.5x and 1x/2x scale factors mean that applications on either
monitor are half of the expected size (1x on the primary and 0.5x on the
secondary).

This is reported upstream as https://bugreports.qt.io/browse/QTBUG-67928

The solution: Ignore the 96dpi which X reports by default and only use the
monitor geometry as scale.

The good: The font size on HiDPI and especially mixed-DPI environments is now
scaled by default.

The bad: You might unintentionally rely on the 96dpi X reports if you have a
HiDPI monitor but keep applications unscaled. That requires manual
configuration now.

The ugly: If you have a primary monitor with != 96dpi, this is a behaviour
change and results in changed appearance of applications. YaST for example uses
bigger fonts, but the UI elements stay the same size.

tl;dr:

Look out for changes in application appearance and report any bugs.
If you have a HiDPI system with custom configuration for DPI or scale, try to
reset it to the defaults again and check whether it behaves as expected.

You can revert to the old behaviour by setting "Xft.dpi: 96" (most
configuration dialogs call it "Force font DPI") or by setting QT_FONT_DPI=96
in the environment.

Cheers,
Fabian


--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >