From e2583e679f289fe748e9f95ccbe29a62d87baf57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 23 Aug 2013 12:36:30 +0200 Subject: [PATCH] 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. --- libkdecorations/kdecoration_plugins_p.cpp | 15 +++------------ libkdecorations/kdecoration_plugins_p.h | 2 +- options.cpp | 13 ++++--------- options.h | 4 ++-- workspace.cpp | 11 ++--------- 5 files changed, 12 insertions(+), 33 deletions(-) diff --git a/libkdecorations/kdecoration_plugins_p.cpp b/libkdecorations/kdecoration_plugins_p.cpp index 7a3e1c82c1..49254e0e5c 100644 --- a/libkdecorations/kdecoration_plugins_p.cpp +++ b/libkdecorations/kdecoration_plugins_p.cpp @@ -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() diff --git a/libkdecorations/kdecoration_plugins_p.h b/libkdecorations/kdecoration_plugins_p.h index 1a96a01853..95b31b9430 100644 --- a/libkdecorations/kdecoration_plugins_p.h +++ b/libkdecorations/kdecoration_plugins_p.h @@ -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? diff --git a/options.cpp b/options.cpp index 5e9e60251c..517c3d45b9 100644 --- a/options.cpp +++ b/options.cpp @@ -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() diff --git a/options.h b/options.h index 040eb614ef..6d5addbff9 100644 --- a/options.h +++ b/options.h @@ -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. **/ diff --git a/workspace.cpp b/workspace.cpp index f4e193bf63..fde64a0ee4 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -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