diff --git a/kcmkwin/kwincompositing/advanced.cpp b/kcmkwin/kwincompositing/advanced.cpp index 1c75b0db50..c9c6987542 100644 --- a/kcmkwin/kwincompositing/advanced.cpp +++ b/kcmkwin/kwincompositing/advanced.cpp @@ -12,6 +12,8 @@ License. See the file "COPYING" for the exact licensing terms. #include "advanced.moc" #include +#include + #include "compositingprefs.h" namespace KWin @@ -89,7 +91,12 @@ void KWinAdvancedCompositingOptions::save() config.writeEntry("GLVSync", ui.glVSync->isChecked()); enableButtonApply(false); - emit configSaved(); + + // Send signal to kwin + mKWinConfig->sync(); + // Send signal to all kwin instances + QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reinitCompositing"); + QDBusConnection::sessionBus().send(message); } } // namespace diff --git a/kcmkwin/kwincompositing/advanced.h b/kcmkwin/kwincompositing/advanced.h index 4efaba9692..33824d3066 100644 --- a/kcmkwin/kwincompositing/advanced.h +++ b/kcmkwin/kwincompositing/advanced.h @@ -36,9 +36,6 @@ class KWinAdvancedCompositingOptions : public KDialog void save(); void compositingModeChanged(); - signals: - void configSaved(); - private: KSharedConfigPtr mKWinConfig; Ui::KWinAdvancedCompositingOptions ui; diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index 7b7cd37125..aa12a80748 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -134,7 +134,6 @@ void KWinCompositingConfig::showAdvancedOptions() KWinAdvancedCompositingOptions* dialog = new KWinAdvancedCompositingOptions(this, mKWinConfig, &mDefaultPrefs); dialog->show(); - connect(dialog, SIGNAL(configSaved()), this, SLOT(configChanged())); } void KWinCompositingConfig::showConfirmDialog() diff --git a/org.kde.KWin.xml b/org.kde.KWin.xml index 64306f7b1e..2aa62dfc34 100644 --- a/org.kde.KWin.xml +++ b/org.kde.KWin.xml @@ -34,6 +34,7 @@ + diff --git a/workspace.cpp b/workspace.cpp index d1dd80a1fa..20f6a7110d 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -135,6 +135,7 @@ Workspace::Workspace( bool restore ) QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.registerObject("/KWin", this); dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", this, SLOT(slotReloadConfig())); + dbus.connect(QString(), "/KWin", "org.kde.KWin", "reinitCompositing", this, SLOT(slotReinitCompositing())); _self = this; mgr = new PluginMgr; QX11Info info; @@ -1049,6 +1050,19 @@ void Workspace::slotReconfigure() } } +void Workspace::slotReinitCompositing() + { + // Reparse config. Config options will be reloaded by setupCompositing() + KGlobal::config()->reparseConfiguration(); + + // Stop any current compositing + finishCompositing(); + // And start new one + setupCompositing(); + if( effects ) // setupCompositing() may fail + effects->reconfigure(); + } + void Workspace::loadDesktopSettings() { KSharedConfig::Ptr c = KGlobal::config(); diff --git a/workspace.h b/workspace.h index 55fa56a43b..e7733ee370 100644 --- a/workspace.h +++ b/workspace.h @@ -433,6 +433,7 @@ class Workspace : public QObject, public KDecorationDefines void slotSettingsChanged( int category ); void slotReconfigure(); + void slotReinitCompositing(); void slotKillWindow();