diff --git a/decorations.cpp b/decorations.cpp index 70948fbae1..627c98b14a 100644 --- a/decorations.cpp +++ b/decorations.cpp @@ -46,6 +46,7 @@ DecorationPlugin::DecorationPlugin(QObject *parent) #ifdef KWIN_BUILD_DECORATIONS loadPlugin(QString()); // load the plugin specified in cfg file connect(factory(), &KDecorationFactory::recreateDecorations, this, &DecorationPlugin::recreateDecorations); + connect(this, &DecorationPlugin::compositingToggled, options, &KDecorationOptions::compositingChanged); #else setDisabled(true); #endif @@ -134,14 +135,6 @@ Qt::Corner DecorationPlugin::closeButtonCorner() return factory()->closeButtonCorner(); } -void DecorationPlugin::resetCompositing() -{ - if (m_disabled) { - return; - } - factory()->reset(SettingCompositing); -} - QString DecorationPlugin::supportInformation() { if (m_disabled) { diff --git a/decorations.h b/decorations.h index 0534ebec14..694c2ca37b 100644 --- a/decorations.h +++ b/decorations.h @@ -50,8 +50,10 @@ public: QString supportInformation(); +Q_SIGNALS: + void compositingToggled(); + public Q_SLOTS: - void resetCompositing(); void recreateDecorations(); protected: virtual void error(const QString& error_msg); diff --git a/libkdecorations/kdecoration.h b/libkdecorations/kdecoration.h index 596087d245..7d08d3c5d3 100644 --- a/libkdecorations/kdecoration.h +++ b/libkdecorations/kdecoration.h @@ -460,6 +460,10 @@ Q_SIGNALS: * some decoration specific settings need to be updated. */ void configChanged(); + /** + * @brief Emitted when the compositing state in KWin core changes. + */ + void compositingChanged(); protected: /** @internal */ diff --git a/workspace.cpp b/workspace.cpp index 28f1c3cb29..da99a58e1d 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -232,7 +232,7 @@ Workspace::Workspace(bool restore) m_compositor = Compositor::create(this); connect(this, SIGNAL(currentDesktopChanged(int,KWin::Client*)), m_compositor, SLOT(addRepaintFull())); - connect(m_compositor, SIGNAL(compositingToggled(bool)), decorationPlugin(), SLOT(resetCompositing())); + connect(m_compositor, &Compositor::compositingToggled, decorationPlugin(), &DecorationPlugin::compositingToggled); new DBusInterface(this);