Add reinitCompositing dbus signal that reinits compositing (reconfigure signal doesn't and

shouldn't cause that) and use it when advanced compositing settings change.

svn path=/trunk/KDE/kdebase/workspace/; revision=714813
This commit is contained in:
Rivo Laks 2007-09-20 17:19:19 +00:00
parent 45aab602ef
commit 69058845e6
6 changed files with 24 additions and 5 deletions

View file

@ -12,6 +12,8 @@ License. See the file "COPYING" for the exact licensing terms.
#include "advanced.moc"
#include <klocale.h>
#include <QtDBus/QtDBus>
#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

View file

@ -36,9 +36,6 @@ class KWinAdvancedCompositingOptions : public KDialog
void save();
void compositingModeChanged();
signals:
void configSaved();
private:
KSharedConfigPtr mKWinConfig;
Ui::KWinAdvancedCompositingOptions ui;

View file

@ -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()

View file

@ -34,6 +34,7 @@
<method name="previousDesktop"/>
<method name="circulateDesktopApplications"/>
<signal name="reloadConfig"/>
<signal name="reinitCompositing"/>
<method name="loadEffect">
<arg name="name" type="s" direction="in"/>
</method>

View file

@ -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();

View file

@ -433,6 +433,7 @@ class Workspace : public QObject, public KDecorationDefines
void slotSettingsChanged( int category );
void slotReconfigure();
void slotReinitCompositing();
void slotKillWindow();