From 141dae20ed140bc2ac9f0ccaac68d5439fac2e37 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Fri, 28 Nov 2008 12:34:41 +0000 Subject: [PATCH] Reload decorations when enabling or disabling compositing as well. svn path=/trunk/KDE/kdebase/workspace/; revision=890055 --- kcmkwin/kwincompositing/main.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index b0de661936..8dd32f71eb 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -791,19 +791,31 @@ 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" ); + + KConfigGroup effectConfig; + + effectConfig = KConfigGroup( mBackupConfig, "Compositing" ); + bool enabledBefore = effectConfig.readEntry( "Enabled", mDefaultPrefs.enableCompositing() ); + effectConfig = KConfigGroup( mNewConfig, "Compositing" ); + bool enabledAfter = effectConfig.readEntry( "Enabled", mDefaultPrefs.enableCompositing() ); + + effectConfig = KConfigGroup( mBackupConfig, "Plugins" ); bool shadowBefore = effectEnabled( "shadow", effectConfig ); effectConfig = KConfigGroup( mNewConfig, "Plugins" ); bool shadowAfter = effectEnabled( "shadow", effectConfig ); - if( shadowBefore != shadowAfter ) + + if( enabledBefore != enabledAfter || 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() );