From 657aa35d8f6732cee34b90bab332a455b1ce2610 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 6 Oct 2023 12:35:47 +0200 Subject: [PATCH] Revert "main: directly set Xwayland scale, instead of starting a KCM to do the same" This reverts commit 2eb72d082001ede5c38cdbff843dc785c543721a. The KCMs set more than just the DPI, so it's best to keep running them --- src/main.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e17d5a181e..73f4bb5101 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -384,15 +384,8 @@ void Application::setXwaylandScale(qreal scale) Q_ASSERT(scale != 0); if (scale != m_xwaylandScale) { m_xwaylandScale = scale; - // change the font dpi to match - const int dpi = std::round(scale * 96); - 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); + // rerun the fonts kcm init that does the appropriate xrdb call with the new settings + QProcess::startDetached("kcminit", {"kcm_fonts", "kcm_style"}); Q_EMIT xwaylandScaleChanged(); } }