diff --git a/decorations/decorationbridge.cpp b/decorations/decorationbridge.cpp
index 5afdbdfbf4..e1a00f9434 100644
--- a/decorations/decorationbridge.cpp
+++ b/decorations/decorationbridge.cpp
@@ -68,6 +68,11 @@ DecorationBridge::DecorationBridge(QObject *parent)
, m_settings()
, m_noPlugin(false)
{
+ KConfigGroup cg(KSharedConfig::openConfig(), "KDE");
+
+ // try to extract the proper defaults file from a lookandfeel package
+ const QString looknfeel = cg.readEntry(QStringLiteral("LookAndFeelPackage"), "org.kde.breeze.desktop");
+ m_lnfConfig = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("plasma/look-and-feel/") + looknfeel + QStringLiteral("/contents/defaults")));
}
DecorationBridge::~DecorationBridge()
@@ -75,9 +80,12 @@ DecorationBridge::~DecorationBridge()
s_self = nullptr;
}
-static QString readPlugin()
+QString DecorationBridge::readPlugin()
{
- return kwinApp()->config()->group(s_pluginName).readEntry("library", s_defaultPlugin);
+ //Try to get a default from look and feel
+ KConfigGroup cg(m_lnfConfig, "kwinrc");
+ cg = KConfigGroup(&cg, "org.kde.kdecoration2");
+ return kwinApp()->config()->group(s_pluginName).readEntry("library", cg.readEntry("library", s_defaultPlugin));
}
static bool readNoPlugin()
@@ -87,7 +95,10 @@ static bool readNoPlugin()
QString DecorationBridge::readTheme() const
{
- return kwinApp()->config()->group(s_pluginName).readEntry("theme", m_defaultTheme);
+ //Try to get a default from look and feel
+ KConfigGroup cg(m_lnfConfig, "kwinrc");
+ cg = KConfigGroup(&cg, "org.kde.kdecoration2");
+ return kwinApp()->config()->group(s_pluginName).readEntry("theme", cg.readEntry("theme", m_defaultTheme));
}
void DecorationBridge::init()
diff --git a/decorations/decorationbridge.h b/decorations/decorationbridge.h
index e729528fd5..db0d7940df 100644
--- a/decorations/decorationbridge.h
+++ b/decorations/decorationbridge.h
@@ -24,6 +24,8 @@ along with this program. If not, see .
#include
+#include
+
#include
#include
@@ -68,11 +70,13 @@ public:
QString supportInformation() const;
private:
+ QString readPlugin();
void loadMetaData(const QJsonObject &object);
void findTheme(const QVariantMap &map);
void initPlugin();
QString readTheme() const;
KPluginFactory *m_factory;
+ KSharedConfig::Ptr m_lnfConfig;
bool m_blur;
QString m_plugin;
QString m_defaultTheme;