[Development] Updated high-DPI support for Qt 5.14

Allan Jensen Allan.Jensen at qt.io
Thu Sep 26 11:38:02 CEST 2019


On Thursday, 26 September 2019 09:29:10 CEST Shawn Rutledge wrote:
> KDE also needs to set env variables to get correct behavior, right?  Which
> ones does it do right?  Which ones are wrong or unnecessary in 5.14?

KDE sets the Qt environment variables to set the right scaling. GNOME has 
their own settings, and refuses to set Qt environment variables, on GTK/XCB 
desktops we currently just use the fallback DPI value GNOME sets for Xft 
applications, which is a fixed value of (96 * scaling_ratio).

Beyond that there is the screen values from X11. Both physical reported screen 
size (from EDID I believe) and a DPI number from xrandr. It appears we only 
use the former now. Not sure if they recalculate based on each other, but at 
least some years ago GNOME used to override the latter of the two. As long as 
nothing else is overriding or environmental values control Qt's scaling, I 
believe users can change these X11 values to get Qt to scale per screen.

There is also the fontconfig dpi setting, but I think everybody ignores that 
these days.

Ideally we should implement something listening to the real GNOME settings, so 
we can get per screen data, and make it also works for wayland. We could also 
provide a better way for KDE to configure our settings without environment 
variables, but at least KDE is willing to set what we need, so it is less of 
an issue.

'Allan





More information about the Development mailing list