From 7c0628f3375686a89d676473e3b78de15643eeea Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Tue, 25 Nov 2008 10:06:44 +0000 Subject: [PATCH] Reload decorations when any shadow-related settings are changed. svn path=/trunk/KDE/kdebase/workspace/; revision=888747 --- effects/shadow_config.cpp | 5 +++++ kcmkwin/kwincompositing/main.cpp | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/effects/shadow_config.cpp b/effects/shadow_config.cpp index 645f31517b..61a82a2b5d 100644 --- a/effects/shadow_config.cpp +++ b/effects/shadow_config.cpp @@ -25,6 +25,7 @@ along with this program. If not, see . #include +#include #include #include #ifndef KDE_USE_FINAL @@ -116,6 +117,10 @@ void ShadowEffectConfig::save() emit changed(false); EffectsHandler::sendReloadMessage( "shadow" ); + + // We also need to reload decorations + QDBusMessage message = QDBusMessage::createMethodCall( "org.kde.kwin", "/KWin", "org.kde.KWin", "reconfigure" ); + QDBusConnection::sessionBus().send( message ); } void ShadowEffectConfig::defaults() diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index 8ebaeb8922..b0de661936 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -791,6 +791,19 @@ bool KWinCompositingConfig::sendKWinReloadSignal() QDBusMessage message = QDBusMessage::createSignal( "/KWin", "org.kde.KWin", "reloadCompositingConfig" ); QDBusConnection::sessionBus().send(message); + // If we added or removed shadows we need to reload decorations as well + // We have to do this separately so the settings are in sync + // HACK: This should really just reload decorations, not do a full reconfigure + KConfigGroup effectConfig( mBackupConfig, "Plugins" ); + bool shadowBefore = effectEnabled( "shadow", effectConfig ); + effectConfig = KConfigGroup( mNewConfig, "Plugins" ); + bool shadowAfter = effectEnabled( "shadow", effectConfig ); + if( shadowBefore != shadowAfter ) + { + message = QDBusMessage::createMethodCall( "org.kde.kwin", "/KWin", "org.kde.KWin", "reconfigure" ); + QDBusConnection::sessionBus().send( message ); + } + // If compositing is enabled, check if it could be started. KConfigGroup newGroup( mNewConfig, "Compositing" ); bool enabled = newGroup.readEntry( "Enabled", mDefaultPrefs.enableCompositing() );