Revert "main: directly set Xwayland scale, instead of starting a KCM to do the same"

This reverts commit 2eb72d0820. The KCMs set more than just
the DPI, so it's best to keep running them
master
Xaver Hugl 12 months ago
parent 2b79316e4b
commit 657aa35d8f

@ -384,15 +384,8 @@ void Application::setXwaylandScale(qreal scale)
Q_ASSERT(scale != 0); Q_ASSERT(scale != 0);
if (scale != m_xwaylandScale) { if (scale != m_xwaylandScale) {
m_xwaylandScale = scale; m_xwaylandScale = scale;
// change the font dpi to match // rerun the fonts kcm init that does the appropriate xrdb call with the new settings
const int dpi = std::round(scale * 96); QProcess::startDetached("kcminit", {"kcm_fonts", "kcm_style"});
const QByteArray input = "Xft.dpi: " + QByteArray::number(dpi);
QProcess p;
p.start(QStringLiteral("xrdb"), {QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp")});
p.setProcessChannelMode(QProcess::ForwardedChannels);
p.write(input);
p.closeWriteChannel();
p.waitForFinished(-1);
Q_EMIT xwaylandScaleChanged(); Q_EMIT xwaylandScaleChanged();
} }
} }

Loading…
Cancel
Save