Move to runtime check of valid font DPI

The current code checks if we have an entry, but not that the entry is
sane.

BUG: 449918
FIXED-IN: 5.24.1


(cherry picked from commit 0bb681869f)
wilder-5.24
David Edmundson 4 years ago committed by Nate Graham
parent ef454e9d77
commit 6c2d9d4a66
  1. 5
      kcms/fonts/fontinit.cpp

@ -19,11 +19,12 @@ Q_DECL_EXPORT void kcminit()
QString fontDpiKey = KWindowSystem::isPlatformWayland() ? QStringLiteral("forceFontDPIWayland") : QStringLiteral("forceFontDPI");
if (!fontsCfg.hasKey(fontDpiKey)) {
const int dpi = fontsCfg.readEntry(fontDpiKey, 0);
if (dpi <= 0) {
return;
}
const QByteArray input = "Xft.dpi: " + QByteArray::number(fontsCfg.readEntry(fontDpiKey, 0));
const QByteArray input = "Xft.dpi: " + QByteArray::number(dpi);
QProcess p;
p.start(QStringLiteral("xrdb"), {QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp")});
p.setProcessChannelMode(QProcess::ForwardedChannels);

Loading…
Cancel
Save