diff --git a/kcms/fonts/fonts.h b/kcms/fonts/fonts.h --- a/kcms/fonts/fonts.h +++ b/kcms/fonts/fonts.h @@ -183,6 +183,7 @@ private: void updateNeedsSave(); + void saveFontToGtkSettings(); QFont applyFontDiff(const QFont &fnt, const QFont &newFont, int fontDiffFlags); QFont m_defaultFont; diff --git a/kcms/fonts/fonts.cpp b/kcms/fonts/fonts.cpp --- a/kcms/fonts/fonts.cpp +++ b/kcms/fonts/fonts.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,10 @@ #include #include #include +#include + +#include +#include #include "../krdb/krdb.h" #include "previewimageprovider.h" @@ -569,6 +574,8 @@ cg.writeEntry("activeFont", m_windowTitleFont.toString()); cg.sync(); + saveFontToGtkSettings(); + m_defaultFontOriginal = m_defaultFont; m_generalFontOriginal = m_generalFont; m_fixedWidthFontOriginal = m_fixedWidthFont; @@ -602,6 +609,16 @@ setNeedsSave(false); } +void KFonts::saveFontToGtkSettings() +{ + QDBusInterface kdedInterface { + QStringLiteral("org.kde.kded5"), + QStringLiteral("/modules/gtkconfig"), + QStringLiteral("org.kde.gtkconfig") + }; + kdedInterface.call("setFont", m_generalFont.toString()); +} + void KFonts::updateNeedsSave() { setNeedsSave(m_defaultFontOriginal != m_defaultFont ||