High DPI support - Akademy Notes

David Edmundson david at davidedmundson.co.uk
Sun Sep 14 13:00:42 UTC 2014


High DPI

Recap:
A change is coming in Qt 5.4 which brings in high DPI support at a Qt level.
In short; there's a separation from real pixels and "device pixels". All
progammers write as though the screen is 96dpi, then sizes are multiplied
as appropriate.

The clever part is that when loading pixmaps, icons or textures use the
real size, so nothing gets blocky.

Scaling however, can only be an integer, 2 4 or in the future 8.

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.

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.

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.


Tasks:
- Testing and reporting back their experience - assigned to Sebas, Vishesh
and Alex

- Investigate how GTK will handle it? - assigned to Dave
- How does GNOME do it / set it up? (will our apps work correctly in
GNOME?) - assigned to Dave


David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140914/dbaa8c46/attachment.html>


More information about the Plasma-devel mailing list