From 1ff3cd968446b24e6543125090b04e84ff6e5d87 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 6 Oct 2023 12:40:34 +0200 Subject: [PATCH] main: set config values for fonts and style KCMs to do their job --- src/main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 73f4bb5101..349eb675e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -384,8 +384,18 @@ void Application::setXwaylandScale(qreal scale) Q_ASSERT(scale != 0); if (scale != m_xwaylandScale) { m_xwaylandScale = scale; - // rerun the fonts kcm init that does the appropriate xrdb call with the new settings - QProcess::startDetached("kcminit", {"kcm_fonts", "kcm_style"}); + KConfig cfg(QStringLiteral("kdeglobals")); + KConfigGroup kscreenGroup = cfg.group("KScreen"); + const bool xwaylandClientsScale = kscreenGroup.readEntry("XwaylandClientsScale", true); + if (xwaylandClientsScale) { + kwinApp()->config()->group("Xwayland").writeEntry("Scale", m_xwaylandScale, KConfig::Notify); + } else { + kwinApp()->config()->group("Xwayland").deleteEntry("Scale", KConfig::Notify); + } + if (x11Connection()) { + // 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(); } }