support for high dpi in aurorae
ClosedPublic

Authored by mart on Mar 20 2017, 3:37 PM.

Details

Summary

aurorae themes have hardoded sizes in pixels in their config files,
but the framesvgs scale by themselves based on font dpi leading
to corrupt results

scale all sizes using the same logic(that's also used in c++ based
kdecorations), gives correct looking scaled decorations
BUG:375868

Test Plan

see screenshot

Diff Detail

Repository
R108 KWin
Branch
phab/auroraedpi
Lint
No Linters Available
Unit
No Unit Test Coverage
mart created this revision.Mar 20 2017, 3:37 PM
Restricted Application added a project: KWin. · View Herald TranscriptMar 20 2017, 3:37 PM
Restricted Application added subscribers: KWin, kwin, plasma-devel. · View Herald Transcript
graesslin accepted this revision.Mar 20 2017, 3:57 PM
This revision is now accepted and ready to land.Mar 20 2017, 3:57 PM
This revision was automatically updated to reflect the committed changes.

Just saw this because of a bug report.
Why was this patch approved at all?

This line:

scaleFactor = (qreal)dpi / (qreal)96;

is totally nuts. dpi is already qreal, so 96 is implicitly casted and 96.0f or so would have done.

Overmore and far worse, the result is implicitly casted to int scaleFactor, ie. truncated - in doubt to 0.


--> scaleFactor should be float/qreal, if you want and then the various paddings etc. should be like

m_borderLeft = qRound(scaleFactor * border.readEntry("BorderLeft", defaultBorderLeft()));

In addition there should be a sanity check on the dpi return and bonus points if the dpi is calculated as mean of dpiX and dpiY.

And best invoke Kai Uwe Broulik.

Just saw this because of a bug report.

This one I presume: https://bugs.kde.org/show_bug.cgi?id=380524

The bug affects me on 5.10 (I am comment #1)

bonus points if the dpi is calculated as mean of dpiX and dpiY.

Maybe, but it's more important that it matches what frameSvg is doing which is currently :src/declarativeimports/core/units.cpp: const qreal dpi = primary->logicalDotsPerInchX();
If it's set via Xft DPI override, it's set squarely anyway.