No longer pass changed mask from KWin core to the decorations

The changed mask is going to be replaced by more specific signals so
we don't need to calculate the change mask in KWin core anymore.

We still need to call reset in the decoration plugin to check whether
a new decoration library needs to be loaded.
This commit is contained in:
Martin Gräßlin 2013-08-23 12:36:30 +02:00
parent c2fdc66cee
commit e2583e679f
5 changed files with 12 additions and 33 deletions

View file

@ -69,21 +69,12 @@ QString KDecorationPlugins::currentPlugin()
return pluginStr;
}
bool KDecorationPlugins::reset(unsigned long changed)
bool KDecorationPlugins::reset()
{
QString oldPlugin = pluginStr;
config->reparseConfiguration();
bool ret = false;
if ((!loadPlugin(QString()) && library) // "" = read the one in cfg file
|| oldPlugin == pluginStr) {
// no new plugin loaded, reset the old one
// assert( fact != NULL );
if (fact != NULL) {
ret = fact->reset(changed);
}
}
return ret || oldPlugin != pluginStr;
loadPlugin(QString()); // "" = read the one in cfg file
return oldPlugin != pluginStr;
}
KDecorationFactory* KDecorationPlugins::factory()

View file

@ -58,7 +58,7 @@ public:
const KDecorationFactory* factory() const;
KDecoration* createDecoration(KDecorationBridge*);
QString currentPlugin();
bool reset(unsigned long changed); // returns true if decorations need to be recreated
bool reset(); // returns true if decorations need to be recreated
protected:
virtual void error(const QString& error_msg);
QString defaultPlugin; // FRAME normalne protected?

View file

@ -775,9 +775,9 @@ void Options::reparseConfiguration()
m_settings->config()->reparseConfiguration();
}
unsigned long Options::updateSettings()
void Options::updateSettings()
{
unsigned long changed = loadConfig();
loadConfig();
// Read button tooltip animation effect from kdeglobals
// Since we want to allow users to enable window decoration tooltips
// and not kstyle tooltips and vise-versa, we don't read the
@ -792,15 +792,12 @@ unsigned long Options::updateSettings()
reloadCompositingSettings();
emit configChanged();
return changed;
}
unsigned long Options::loadConfig()
void Options::loadConfig()
{
m_settings->readConfig();
unsigned long changed = 0;
changed |= KDecorationOptions::updateSettings(m_settings->config()); // read decoration settings
KDecorationOptions::updateSettings(m_settings->config()); // read decoration settings
syncFromKcfgc();
@ -836,8 +833,6 @@ unsigned long Options::loadConfig()
setMaxFpsInterval(1 * 1000 * 1000 * 1000 / config.readEntry("MaxFPS", Options::defaultMaxFps()));
setRefreshRate(config.readEntry("RefreshRate", Options::defaultRefreshRate()));
setVBlankTime(config.readEntry("VBlankTime", Options::defaultVBlankTime()) * 1000); // config in micro, value in nano resolution
return changed;
}
void Options::syncFromKcfgc()

View file

@ -199,7 +199,7 @@ public:
explicit Options(QObject *parent = NULL);
~Options();
virtual unsigned long updateSettings();
void updateSettings();
/*!
Different focus policies:
@ -735,7 +735,7 @@ public:
/**
* Performs loading all settings except compositing related.
**/
unsigned long loadConfig();
void loadConfig();
/**
* Performs loading of compositing settings which do not depend on OpenGL.
**/

View file

@ -804,22 +804,15 @@ void Workspace::slotReconfigure()
bool borderlessMaximizedWindows = options->borderlessMaximizedWindows();
KSharedConfig::openConfig()->reparseConfiguration();
unsigned long changed = options->updateSettings();
options->updateSettings();
emit configChanged();
m_userActionsMenu->discard();
updateToolWindows(true);
DecorationPlugin *deco = DecorationPlugin::self();
if (!deco->isDisabled() && deco->reset(changed)) {
if (!deco->isDisabled() && deco->reset()) {
// Decorations need to be recreated
// This actually seems to make things worse now
//QWidget curtain;
//curtain.setBackgroundMode( NoBackground );
//curtain.setGeometry( Kephal::ScreenUtils::desktopGeometry() );
//curtain.show();
for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
(*it)->updateDecoration(true, true);
// If the new decoration doesn't supports tabs then ungroup clients