High DPI support - Akademy Notes

Marco Martin notmart at gmail.com
Mon Sep 15 08:17:04 UTC 2014


On Sunday 14 September 2014, David Edmundson wrote:
> Qt's API does this on a per-screen basis.
> Qt's XCB backend is global reading from an environment variable.
> QT_DEVICE_PIXEL_RATIO=2.
> Qt does not take guess it from the monitor size because monitor EDID can't
> be trusted.

we should perhaps make the thing autodetect from edid and provide, maybe in 
the screen config module an ui to manually override it, for desperate cases 
(sucks but the least painful probably?)

> Font scaling is weirdly independent of this.
> 
> It requires changes in our QStyles (Oxygen && Breeze) and almost every
> other cases pixmaps are loaded. Because of this, it requires every app to
> opt-in(!)
> 
> Within plasma if we want to support it we also need to update SVGItem,
> FrameSVGItem and IconItem where I didn't include scaling support.

They actually do scale correctly, but of course right now based on units 
ignoring QT_DEVICE_PIXEL_RATIO, therefore it should be adapted, but shouldn't 
be a long work

> Discussions:
> 
> Wayland
>  - wayland can scale windows (again only by integer factors)
>  - apps can report that they are already scaled (i.e if they're using the
> method above)
> 
> There was general consensus that we need this for QWidget applications. We
> agreed we would needs a settings interface and support in startkde.
> 
> One person suggested that we fix the XCB backend and that it should be
> possible to use the monitor sizes, there were no volunteers on doing it
> though.
> 
> There was some slight concern that a simple scaling of 2 would be rubbish,
> where the scale is out by ~1.5. We need to see it before we can continue
> discussion.

I think is true that may pose some problems for some screens of today, but to 
me having things too small is almost a smaller problem than having blurry 
things. Even svgs scaled by non integer values look surprisingly bad, the 
simpler the svg is, the more evident the problems are.

As for internal qt way vs units, unfortunately units too can't distinguish 
between screens, because there is only one per engine.
If only i had made it Units (uppercase attached property) it would have been 
possible to search for the proper window, but still would have be a bit 
difficult to reassign to a different screen at runtime

-- 
Marco Martin


More information about the Plasma-devel mailing list