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

View file

@ -58,7 +58,7 @@ public:
const KDecorationFactory* factory() const; const KDecorationFactory* factory() const;
KDecoration* createDecoration(KDecorationBridge*); KDecoration* createDecoration(KDecorationBridge*);
QString currentPlugin(); 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: protected:
virtual void error(const QString& error_msg); virtual void error(const QString& error_msg);
QString defaultPlugin; // FRAME normalne protected? QString defaultPlugin; // FRAME normalne protected?

View file

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

View file

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

View file

@ -804,22 +804,15 @@ void Workspace::slotReconfigure()
bool borderlessMaximizedWindows = options->borderlessMaximizedWindows(); bool borderlessMaximizedWindows = options->borderlessMaximizedWindows();
KSharedConfig::openConfig()->reparseConfiguration(); KSharedConfig::openConfig()->reparseConfiguration();
unsigned long changed = options->updateSettings(); options->updateSettings();
emit configChanged(); emit configChanged();
m_userActionsMenu->discard(); m_userActionsMenu->discard();
updateToolWindows(true); updateToolWindows(true);
DecorationPlugin *deco = DecorationPlugin::self(); DecorationPlugin *deco = DecorationPlugin::self();
if (!deco->isDisabled() && deco->reset(changed)) { if (!deco->isDisabled() && deco->reset()) {
// Decorations need to be recreated // 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) for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
(*it)->updateDecoration(true, true); (*it)->updateDecoration(true, true);
// If the new decoration doesn't supports tabs then ungroup clients // If the new decoration doesn't supports tabs then ungroup clients