summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <kde@davidedmundson.co.uk>2017-04-23 23:01:59 (GMT)
committerDavid Edmundson <kde@davidedmundson.co.uk>2017-04-23 23:01:59 (GMT)
commitc67271c0f207720afd85d92ffaa1eaf4841fd8f4 (patch)
tree0c2619ec056faa623b065622408c950edb72c7b6
parent9136ee35684c25ff11e81c3729f1a510ced7250e (diff)
Set xrdb XFT.DPI value as integer
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. Reviewers: #plasma, mart Reviewed By: mart Subscribers: hetzenecker, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5487
-rw-r--r--kcm/src/scalingconfig.cpp4
-rw-r--r--kcm/src/scalingconfig.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/kcm/src/scalingconfig.cpp b/kcm/src/scalingconfig.cpp
index 4606444..c9ae9b6 100644
--- a/kcm/src/scalingconfig.cpp
+++ b/kcm/src/scalingconfig.cpp
@@ -119,9 +119,9 @@ void ScalingConfig::accept()
QDialog::accept();
}
-qreal ScalingConfig::scaleDPI() const
+int ScalingConfig::scaleDPI() const
{
- return scaleFactor() * 96.0;
+ return qRound(scaleFactor() * 96.0);
}
qreal ScalingConfig::scaleFactor() const
diff --git a/kcm/src/scalingconfig.h b/kcm/src/scalingconfig.h
index 5a7100c..11dc4a9 100644
--- a/kcm/src/scalingconfig.h
+++ b/kcm/src/scalingconfig.h
@@ -38,7 +38,7 @@ protected:
private:
void load();
qreal scaleFactor() const;
- qreal scaleDPI() const;
+ int scaleDPI() const;
Ui::Scaling ui;
qreal m_initialScalingFactor = 1.0;
KScreen::OutputList m_outputList;