Set xrdb XFT.DPI value as integer
ClosedPublic

Authored by davidedmundson on Apr 18 2017, 12:48 AM.

Details

Summary

QXcbScreen when loading uses QByteArray.toInt().

QByteArray("152.23").toInt() returns 0, rather than a rounded version,
this means QXcbScreen falls back to the virtualDPI for the logicalDPI
rather than the explicitly set one.

The end result is that my scaling setting didn't work properly.

Diff Detail

Repository
R104 KScreen
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Plasma. · View Herald TranscriptApr 18 2017, 12:48 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hetzenecker added inline comments.
kcm/src/scalingconfig.cpp
124

I'd propse

qRound(scaleFactor() * 96.0)

to get int values. If the scaleFactor is rounded, we only get multiplies of 96 as DPI. This means the icon sizes are wrong again

Awesome! Looks good, this fixes the wrong icon sizes in plasma.

"xrdb -query" reports the correct size and .config/kcmfonts now also stores the integer value. This means the "Force fonts DPI" size is now also shown in the Fonts systemsettings module.

Tested whether it still works after a reboot - it does :)

mart accepted this revision.Apr 20 2017, 10:26 AM
This revision is now accepted and ready to land.Apr 20 2017, 10:26 AM
This revision was automatically updated to reflect the committed changes.