diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -75,13 +75,13 @@ for (QString name : builtinNames) { plugins.writeEntry(name + QStringLiteral("Enabled"), false); } + KConfigGroup wobblyGroup = config->group("Effect-Wobbly"); + wobblyGroup.writeEntry(QStringLiteral("Settings"), QStringLiteral("Custom")); + wobblyGroup.writeEntry(QStringLiteral("OpenEffect"), true); + wobblyGroup.writeEntry(QStringLiteral("CloseEffect"), true); config->sync(); kwinApp()->setConfig(config); - // TODO: make effects use KWin's config directly - KSharedConfig::openConfig(QStringLiteral(KWIN_CONFIG), KConfig::NoGlobals)->group("Effect-Wobbly").writeEntry(QStringLiteral("Settings"), QStringLiteral("Custom")); - KSharedConfig::openConfig(QStringLiteral(KWIN_CONFIG), KConfig::NoGlobals)->group("Effect-Wobbly").writeEntry(QStringLiteral("OpenEffect"), true); - KSharedConfig::openConfig(QStringLiteral(KWIN_CONFIG), KConfig::NoGlobals)->group("Effect-Wobbly").writeEntry(QStringLiteral("CloseEffect"), true); if (QFile::exists(QStringLiteral("/dev/dri/card0"))) { qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); diff --git a/autotests/mock_effectshandler.h b/autotests/mock_effectshandler.h --- a/autotests/mock_effectshandler.h +++ b/autotests/mock_effectshandler.h @@ -252,6 +252,8 @@ callback(QPoint(-1, -1)); } + KSharedConfigPtr config() const override; + private: bool m_animationsSuported = true; }; diff --git a/autotests/mock_effectshandler.cpp b/autotests/mock_effectshandler.cpp --- a/autotests/mock_effectshandler.cpp +++ b/autotests/mock_effectshandler.cpp @@ -23,3 +23,10 @@ : EffectsHandler(type) { } + + +KSharedConfigPtr MockEffectsHandler::config() const +{ + static const KSharedConfigPtr s_config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); + return s_config; +} diff --git a/effects.h b/effects.h --- a/effects.h +++ b/effects.h @@ -234,6 +234,8 @@ void startInteractiveWindowSelection(std::function callback) override; void startInteractivePositionSelection(std::function callback) override; + KSharedConfigPtr config() const override; + Scene *scene() const { return m_scene; } diff --git a/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -1590,6 +1590,11 @@ kwinApp()->platform()->startInteractivePositionSelection(callback); } +KSharedConfigPtr EffectsHandlerImpl::config() const +{ + return kwinApp()->config(); +} + //**************************************** // EffectWindowImpl //**************************************** diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -39,6 +39,7 @@ BlurEffect::BlurEffect() { + initConfig(); shader = BlurShader::create(); m_simpleShader = ShaderManager::instance()->generateShaderFromResources(ShaderTrait::MapTexture, QString(), QStringLiteral("logout-blur.frag")); if (!m_simpleShader->isValid()) { diff --git a/effects/blur/blur.kcfg b/effects/blur/blur.kcfg --- a/effects/blur/blur.kcfg +++ b/effects/blur/blur.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 12 diff --git a/effects/blur/blur_config.cpp b/effects/blur/blur_config.cpp --- a/effects/blur/blur_config.cpp +++ b/effects/blur/blur_config.cpp @@ -20,6 +20,7 @@ #include "blur_config.h" // KConfigSkeleton #include "blurconfig.h" +#include #include #include @@ -36,6 +37,7 @@ : KCModule(KAboutData::pluginData(QStringLiteral("blur")), parent, args) { ui.setupUi(this); + BlurConfig::instance(KWIN_CONFIG); addConfig(BlurConfig::self(), this); load(); diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -54,6 +54,7 @@ , primaryTabBox(false) , secondaryTabBox(false) { + initConfig(); reconfigure(ReconfigureAll); // Caption frame diff --git a/effects/coverswitch/coverswitch.kcfg b/effects/coverswitch/coverswitch.kcfg --- a/effects/coverswitch/coverswitch.kcfg +++ b/effects/coverswitch/coverswitch.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/coverswitch/coverswitch_config.cpp b/effects/coverswitch/coverswitch_config.cpp --- a/effects/coverswitch/coverswitch_config.cpp +++ b/effects/coverswitch/coverswitch_config.cpp @@ -20,6 +20,7 @@ #include "coverswitch_config.h" // KConfigSkeleton #include "coverswitchconfig.h" +#include #include #include @@ -48,6 +49,7 @@ layout->addWidget(m_ui); + CoverSwitchConfig::instance(KWIN_CONFIG); addConfig(CoverSwitchConfig::self(), m_ui); } diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -92,6 +92,7 @@ , m_cubeCapBuffer(NULL) , m_proxy(this) { + initConfig(); desktopNameFont.setBold(true); desktopNameFont.setPointSize(14); diff --git a/effects/cube/cube.kcfg b/effects/cube/cube.kcfg --- a/effects/cube/cube.kcfg +++ b/effects/cube/cube.kcfg @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + diff --git a/effects/cube/cube_config.cpp b/effects/cube/cube_config.cpp --- a/effects/cube/cube_config.cpp +++ b/effects/cube/cube_config.cpp @@ -20,6 +20,7 @@ #include "cube_config.h" // KConfigSkeleton #include "cubeconfig.h" +#include #include #include @@ -84,6 +85,7 @@ connect(m_ui->kcfg_Caps, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged())); m_ui->kcfg_Wallpaper->setFilter(QStringLiteral("*.png *.jpeg *.jpg ")); + CubeConfig::instance(KWIN_CONFIG); addConfig(CubeConfig::self(), m_ui); load(); } diff --git a/effects/cube/cubeslide.cpp b/effects/cube/cubeslide.cpp --- a/effects/cube/cubeslide.cpp +++ b/effects/cube/cubeslide.cpp @@ -37,6 +37,7 @@ , desktopChangedWhileMoving(false) , progressRestriction(0.0f) { + initConfig(); connect(effects, SIGNAL(desktopChanged(int,int)), this, SLOT(slotDesktopChanged(int,int))); connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*))); connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*))); diff --git a/effects/cube/cubeslide.kcfg b/effects/cube/cubeslide.kcfg --- a/effects/cube/cubeslide.kcfg +++ b/effects/cube/cubeslide.kcfg @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/cube/cubeslide_config.cpp b/effects/cube/cubeslide_config.cpp --- a/effects/cube/cubeslide_config.cpp +++ b/effects/cube/cubeslide_config.cpp @@ -20,6 +20,7 @@ #include "cubeslide_config.h" // KConfigSkeleton #include "cubeslideconfig.h" +#include #include #include @@ -48,6 +49,7 @@ layout->addWidget(m_ui); + CubeSlideConfig::instance(KWIN_CONFIG); addConfig(CubeSlideConfig::self(), m_ui); load(); diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -65,6 +65,7 @@ , scaledOffset() , m_proxy(0) { + initConfig(); // Load shortcuts QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ShowDesktopGrid")); diff --git a/effects/desktopgrid/desktopgrid.kcfg b/effects/desktopgrid/desktopgrid.kcfg --- a/effects/desktopgrid/desktopgrid.kcfg +++ b/effects/desktopgrid/desktopgrid.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + diff --git a/effects/desktopgrid/desktopgrid_config.cpp b/effects/desktopgrid/desktopgrid_config.cpp --- a/effects/desktopgrid/desktopgrid_config.cpp +++ b/effects/desktopgrid/desktopgrid_config.cpp @@ -22,6 +22,7 @@ #include "desktopgrid_config.h" // KConfigSkeleton #include "desktopgridconfig.h" +#include #include #include @@ -83,6 +84,7 @@ m_ui->desktopNameAlignmentCombo->addItem(i18n("Top-Left"), QVariant(Qt::AlignLeft | Qt::AlignTop)); m_ui->desktopNameAlignmentCombo->addItem(i18n("Center"), QVariant(Qt::AlignCenter)); + DesktopGridConfig::instance(KWIN_CONFIG); addConfig(DesktopGridConfig::self(), m_ui); connect(m_ui->kcfg_LayoutMode, SIGNAL(currentIndexChanged(int)), this, SLOT(layoutSelectionChanged())); connect(m_ui->desktopNameAlignmentCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); diff --git a/effects/diminactive/diminactive.cpp b/effects/diminactive/diminactive.cpp --- a/effects/diminactive/diminactive.cpp +++ b/effects/diminactive/diminactive.cpp @@ -30,6 +30,7 @@ DimInactiveEffect::DimInactiveEffect() { + initConfig(); reconfigure(ReconfigureAll); timeline.setDuration(animationTime(250)); previousActiveTimeline.setDuration(animationTime(250)); diff --git a/effects/diminactive/diminactive.kcfg b/effects/diminactive/diminactive.kcfg --- a/effects/diminactive/diminactive.kcfg +++ b/effects/diminactive/diminactive.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 25 diff --git a/effects/diminactive/diminactive_config.cpp b/effects/diminactive/diminactive_config.cpp --- a/effects/diminactive/diminactive_config.cpp +++ b/effects/diminactive/diminactive_config.cpp @@ -21,6 +21,7 @@ #include "diminactive_config.h" // KConfigSkeleton #include "diminactiveconfig.h" +#include #include @@ -53,6 +54,7 @@ layout->addWidget(m_ui); + DimInactiveConfig::instance(KWIN_CONFIG); addConfig(DimInactiveConfig::self(), m_ui); load(); diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -34,6 +34,7 @@ FallApartEffect::FallApartEffect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); diff --git a/effects/fallapart/fallapart.kcfg b/effects/fallapart/fallapart.kcfg --- a/effects/fallapart/fallapart.kcfg +++ b/effects/fallapart/fallapart.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 40 diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -47,6 +47,7 @@ , m_hasKeyboardGrab(false) , m_captionFrame(NULL) { + initConfig(); reconfigure(ReconfigureAll); // Caption frame diff --git a/effects/flipswitch/flipswitch.kcfg b/effects/flipswitch/flipswitch.kcfg --- a/effects/flipswitch/flipswitch.kcfg +++ b/effects/flipswitch/flipswitch.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + false diff --git a/effects/flipswitch/flipswitch_config.cpp b/effects/flipswitch/flipswitch_config.cpp --- a/effects/flipswitch/flipswitch_config.cpp +++ b/effects/flipswitch/flipswitch_config.cpp @@ -20,6 +20,7 @@ #include "flipswitch_config.h" // KConfigSkeleton #include "flipswitchconfig.h" +#include #include #include @@ -69,6 +70,7 @@ m_ui->shortcutEditor->addCollection(m_actionCollection); + FlipSwitchConfig::instance(KWIN_CONFIG); addConfig(FlipSwitchConfig::self(), m_ui); load(); diff --git a/effects/glide/glide.cpp b/effects/glide/glide.cpp --- a/effects/glide/glide.cpp +++ b/effects/glide/glide.cpp @@ -36,6 +36,7 @@ GlideEffect::GlideEffect() : Effect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); diff --git a/effects/glide/glide.kcfg b/effects/glide/glide.kcfg --- a/effects/glide/glide.kcfg +++ b/effects/glide/glide.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/glide/glide_config.cpp b/effects/glide/glide_config.cpp --- a/effects/glide/glide_config.cpp +++ b/effects/glide/glide_config.cpp @@ -21,6 +21,7 @@ #include "glide_config.h" // KConfigSkeleton #include "glideconfig.h" +#include #include #include @@ -37,6 +38,7 @@ : KCModule(KAboutData::pluginData(QStringLiteral("glide")), parent, args) { ui.setupUi(this); + GlideConfig::instance(KWIN_CONFIG); addConfig(GlideConfig::self(), this); load(); } diff --git a/effects/kscreen/kscreen.cpp b/effects/kscreen/kscreen.cpp --- a/effects/kscreen/kscreen.cpp +++ b/effects/kscreen/kscreen.cpp @@ -55,6 +55,7 @@ , m_state(StateNormal) , m_atom(effects->announceSupportProperty("_KDE_KWIN_KSCREEN_SUPPORT", this)) { + initConfig(); connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), SLOT(propertyNotify(KWin::EffectWindow*,long))); reconfigure(ReconfigureAll); } diff --git a/effects/kscreen/kscreen.kcfg b/effects/kscreen/kscreen.kcfg --- a/effects/kscreen/kscreen.kcfg +++ b/effects/kscreen/kscreen.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -52,6 +52,7 @@ , m_enabled(false) , m_valid(false) { + initConfig(); QAction* a; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); diff --git a/effects/lookingglass/lookingglass.kcfg b/effects/lookingglass/lookingglass.kcfg --- a/effects/lookingglass/lookingglass.kcfg +++ b/effects/lookingglass/lookingglass.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 200 diff --git a/effects/lookingglass/lookingglass_config.cpp b/effects/lookingglass/lookingglass_config.cpp --- a/effects/lookingglass/lookingglass_config.cpp +++ b/effects/lookingglass/lookingglass_config.cpp @@ -22,6 +22,7 @@ // KConfigSkeleton #include "lookingglassconfig.h" +#include #include #include @@ -58,6 +59,7 @@ layout->addWidget(m_ui); + LookingGlassConfig::instance(KWIN_CONFIG); addConfig(LookingGlassConfig::self(), m_ui); connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); diff --git a/effects/magiclamp/magiclamp.cpp b/effects/magiclamp/magiclamp.cpp --- a/effects/magiclamp/magiclamp.cpp +++ b/effects/magiclamp/magiclamp.cpp @@ -34,6 +34,7 @@ MagicLampEffect::MagicLampEffect() { + initConfig(); mActiveAnimations = 0; reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); diff --git a/effects/magiclamp/magiclamp.kcfg b/effects/magiclamp/magiclamp.kcfg --- a/effects/magiclamp/magiclamp.kcfg +++ b/effects/magiclamp/magiclamp.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/magiclamp/magiclamp_config.cpp b/effects/magiclamp/magiclamp_config.cpp --- a/effects/magiclamp/magiclamp_config.cpp +++ b/effects/magiclamp/magiclamp_config.cpp @@ -20,6 +20,7 @@ #include "magiclamp_config.h" // KConfigSkeleton #include "magiclampconfig.h" +#include #include @@ -50,6 +51,7 @@ layout->addWidget(m_ui); + MagicLampConfig::instance(KWIN_CONFIG); addConfig(MagicLampConfig::self(), m_ui); load(); diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -50,6 +50,7 @@ , m_pixmap(XCB_PIXMAP_NONE) #endif { + initConfig(); QAction* a; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); diff --git a/effects/magnifier/magnifier.kcfg b/effects/magnifier/magnifier.kcfg --- a/effects/magnifier/magnifier.kcfg +++ b/effects/magnifier/magnifier.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 200 diff --git a/effects/magnifier/magnifier_config.cpp b/effects/magnifier/magnifier_config.cpp --- a/effects/magnifier/magnifier_config.cpp +++ b/effects/magnifier/magnifier_config.cpp @@ -21,6 +21,7 @@ #include "magnifier_config.h" // KConfigSkeleton #include "magnifierconfig.h" +#include #include #include @@ -57,6 +58,7 @@ layout->addWidget(m_ui); + MagnifierConfig::instance(KWIN_CONFIG); addConfig(MagnifierConfig::self(), m_ui); connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); diff --git a/effects/mouseclick/mouseclick.cpp b/effects/mouseclick/mouseclick.cpp --- a/effects/mouseclick/mouseclick.cpp +++ b/effects/mouseclick/mouseclick.cpp @@ -43,6 +43,7 @@ MouseClickEffect::MouseClickEffect() { + initConfig(); m_enabled = false; QAction* a = new QAction(this); diff --git a/effects/mouseclick/mouseclick.kcfg b/effects/mouseclick/mouseclick.kcfg --- a/effects/mouseclick/mouseclick.kcfg +++ b/effects/mouseclick/mouseclick.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + QColor(Qt::red) diff --git a/effects/mouseclick/mouseclick_config.cpp b/effects/mouseclick/mouseclick_config.cpp --- a/effects/mouseclick/mouseclick_config.cpp +++ b/effects/mouseclick/mouseclick_config.cpp @@ -21,6 +21,7 @@ #include "mouseclick_config.h" // KConfigSkeleton #include "mouseclickconfig.h" +#include #include #include @@ -67,6 +68,7 @@ m_ui->editor->addCollection(m_actionCollection); + MouseClickConfig::instance(KWIN_CONFIG); addConfig(MouseClickConfig::self(), m_ui); load(); } diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -46,6 +46,7 @@ MouseMarkEffect::MouseMarkEffect() { + initConfig(); QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ClearMouseMarks")); a->setText(i18n("Clear All Mouse Marks")); diff --git a/effects/mousemark/mousemark.kcfg b/effects/mousemark/mousemark.kcfg --- a/effects/mousemark/mousemark.kcfg +++ b/effects/mousemark/mousemark.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 3 diff --git a/effects/mousemark/mousemark_config.cpp b/effects/mousemark/mousemark_config.cpp --- a/effects/mousemark/mousemark_config.cpp +++ b/effects/mousemark/mousemark_config.cpp @@ -22,6 +22,7 @@ // KConfigSkeleton #include "mousemarkconfig.h" +#include #include #include @@ -58,6 +59,7 @@ layout->addWidget(m_ui); + MouseMarkConfig::instance(KWIN_CONFIG); addConfig(MouseMarkConfig::self(), m_ui); // Shortcut config. The shortcut belongs to the component "kwin"! diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -62,6 +62,7 @@ , m_closeView(NULL) , m_closeWindow(NULL) { + initConfig(); m_atomDesktop = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_DESKTOP", this); m_atomWindows = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_GROUP", this); diff --git a/effects/presentwindows/presentwindows.kcfg b/effects/presentwindows/presentwindows.kcfg --- a/effects/presentwindows/presentwindows.kcfg +++ b/effects/presentwindows/presentwindows.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/presentwindows/presentwindows_config.cpp b/effects/presentwindows/presentwindows_config.cpp --- a/effects/presentwindows/presentwindows_config.cpp +++ b/effects/presentwindows/presentwindows_config.cpp @@ -22,6 +22,7 @@ #include "presentwindows_config.h" // KConfigSkeleton #include "presentwindowsconfig.h" +#include #include #include @@ -84,6 +85,7 @@ connect(m_ui->shortcutEditor, SIGNAL(keyChange()), this, SLOT(changed())); + PresentWindowsConfig::instance(KWIN_CONFIG); addConfig(PresentWindowsConfig::self(), m_ui); load(); diff --git a/effects/resize/resize.cpp b/effects/resize/resize.cpp --- a/effects/resize/resize.cpp +++ b/effects/resize/resize.cpp @@ -40,6 +40,7 @@ , m_active(false) , m_resizeWindow(0) { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*))); connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*,QRect))); diff --git a/effects/resize/resize.kcfg b/effects/resize/resize.kcfg --- a/effects/resize/resize.kcfg +++ b/effects/resize/resize.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + true diff --git a/effects/resize/resize_config.cpp b/effects/resize/resize_config.cpp --- a/effects/resize/resize_config.cpp +++ b/effects/resize/resize_config.cpp @@ -20,6 +20,7 @@ #include "resize_config.h" // KConfigSkeleton #include "resizeconfig.h" +#include #include #include @@ -49,6 +50,7 @@ layout->addWidget(m_ui); + ResizeConfig::instance(KWIN_CONFIG); addConfig(ResizeConfig::self(), m_ui); load(); diff --git a/effects/sheet/sheet.cpp b/effects/sheet/sheet.cpp --- a/effects/sheet/sheet.cpp +++ b/effects/sheet/sheet.cpp @@ -35,6 +35,7 @@ SheetEffect::SheetEffect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); diff --git a/effects/sheet/sheet.kcfg b/effects/sheet/sheet.kcfg --- a/effects/sheet/sheet.kcfg +++ b/effects/sheet/sheet.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/showfps/showfps.cpp b/effects/showfps/showfps.cpp --- a/effects/showfps/showfps.cpp +++ b/effects/showfps/showfps.cpp @@ -47,6 +47,7 @@ , frames_pos(0) , m_noBenchmark(effects->effectFrame(EffectFrameUnstyled, false)) { + initConfig(); for (int i = 0; i < NUM_PAINTS; ++i) { diff --git a/effects/showfps/showfps.kcfg b/effects/showfps/showfps.kcfg --- a/effects/showfps/showfps.kcfg +++ b/effects/showfps/showfps.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/showfps/showfps_config.cpp b/effects/showfps/showfps_config.cpp --- a/effects/showfps/showfps_config.cpp +++ b/effects/showfps/showfps_config.cpp @@ -22,6 +22,7 @@ // KConfigSkeleton #include "showfpsconfig.h" +#include #include #include @@ -41,6 +42,7 @@ m_ui = new Ui::ShowFpsEffectConfigForm; m_ui->setupUi(this); + ShowFpsConfig::instance(KWIN_CONFIG); addConfig(ShowFpsConfig::self(), this); load(); diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -33,6 +33,7 @@ SlidingPopupsEffect::SlidingPopupsEffect() { + initConfig(); KWayland::Server::Display *display = effects->waylandDisplay(); if (display) { display->createSlideManager(this)->create(); diff --git a/effects/slidingpopups/slidingpopups.kcfg b/effects/slidingpopups/slidingpopups.kcfg --- a/effects/slidingpopups/slidingpopups.kcfg +++ b/effects/slidingpopups/slidingpopups.kcfg @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/thumbnailaside/thumbnailaside.cpp b/effects/thumbnailaside/thumbnailaside.cpp --- a/effects/thumbnailaside/thumbnailaside.cpp +++ b/effects/thumbnailaside/thumbnailaside.cpp @@ -32,6 +32,7 @@ ThumbnailAsideEffect::ThumbnailAsideEffect() { + initConfig(); QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); diff --git a/effects/thumbnailaside/thumbnailaside.kcfg b/effects/thumbnailaside/thumbnailaside.kcfg --- a/effects/thumbnailaside/thumbnailaside.kcfg +++ b/effects/thumbnailaside/thumbnailaside.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 200 diff --git a/effects/thumbnailaside/thumbnailaside_config.cpp b/effects/thumbnailaside/thumbnailaside_config.cpp --- a/effects/thumbnailaside/thumbnailaside_config.cpp +++ b/effects/thumbnailaside/thumbnailaside_config.cpp @@ -21,6 +21,7 @@ #include "thumbnailaside_config.h" // KConfigSkeleton #include "thumbnailasideconfig.h" +#include #include #include @@ -58,6 +59,7 @@ connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + ThumbnailAsideConfig::instance(KWIN_CONFIG); addConfig(ThumbnailAsideConfig::self(), this); // Shortcut config. The shortcut belongs to the component "kwin"! diff --git a/effects/trackmouse/trackmouse.cpp b/effects/trackmouse/trackmouse.cpp --- a/effects/trackmouse/trackmouse.cpp +++ b/effects/trackmouse/trackmouse.cpp @@ -45,6 +45,7 @@ : m_active(false) , m_angle(0) { + initConfig(); m_texture[0] = m_texture[1] = 0; #ifdef KWIN_HAVE_XRENDER_COMPOSITING m_picture[0] = m_picture[1] = 0; diff --git a/effects/trackmouse/trackmouse.kcfg b/effects/trackmouse/trackmouse.kcfg --- a/effects/trackmouse/trackmouse.kcfg +++ b/effects/trackmouse/trackmouse.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + true diff --git a/effects/trackmouse/trackmouse_config.cpp b/effects/trackmouse/trackmouse_config.cpp --- a/effects/trackmouse/trackmouse_config.cpp +++ b/effects/trackmouse/trackmouse_config.cpp @@ -20,6 +20,7 @@ *********************************************************************/ #include +#include #include #include @@ -51,7 +52,7 @@ TrackMouseEffectConfig::TrackMouseEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("trackmouse")), parent, args) { - + TrackMouseConfig::instance(KWIN_CONFIG); m_ui = new TrackMouseEffectConfigForm(this); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(m_ui); diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -34,6 +34,7 @@ WindowGeometry::WindowGeometry() { + initConfig(); iAmActivated = true; iAmActive = false; myResizeWindow = 0L; diff --git a/effects/windowgeometry/windowgeometry.kcfg b/effects/windowgeometry/windowgeometry.kcfg --- a/effects/windowgeometry/windowgeometry.kcfg +++ b/effects/windowgeometry/windowgeometry.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + true diff --git a/effects/windowgeometry/windowgeometry_config.cpp b/effects/windowgeometry/windowgeometry_config.cpp --- a/effects/windowgeometry/windowgeometry_config.cpp +++ b/effects/windowgeometry/windowgeometry_config.cpp @@ -21,6 +21,7 @@ #include "windowgeometry_config.h" // KConfigSkeleton #include "windowgeometryconfig.h" +#include #include #include @@ -46,6 +47,7 @@ WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("windowgeometry")), parent, args) { + WindowGeometryConfiguration::instance(KWIN_CONFIG); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(myUi = new WindowGeometryConfigForm(this)); diff --git a/effects/wobblywindows/wobblywindows.cpp b/effects/wobblywindows/wobblywindows.cpp --- a/effects/wobblywindows/wobblywindows.cpp +++ b/effects/wobblywindows/wobblywindows.cpp @@ -146,6 +146,7 @@ WobblyWindowsEffect::WobblyWindowsEffect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); diff --git a/effects/wobblywindows/wobblywindows.kcfg b/effects/wobblywindows/wobblywindows.kcfg --- a/effects/wobblywindows/wobblywindows.kcfg +++ b/effects/wobblywindows/wobblywindows.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/wobblywindows/wobblywindows_config.cpp b/effects/wobblywindows/wobblywindows_config.cpp --- a/effects/wobblywindows/wobblywindows_config.cpp +++ b/effects/wobblywindows/wobblywindows_config.cpp @@ -22,6 +22,7 @@ #include "wobblywindows_config.h" // KConfigSkeleton #include "wobblywindowsconfig.h" +#include #include #include @@ -82,6 +83,7 @@ WobblyWindowsEffectConfig::WobblyWindowsEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("wobblywindows")), parent, args) { + WobblyWindowsConfig::instance(KWIN_CONFIG); m_ui.setupUi(this); addConfig(WobblyWindowsConfig::self(), this); diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -60,6 +60,7 @@ , yMove(0) , moveFactor(20.0) { + initConfig(); QAction* a = 0; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); diff --git a/effects/zoom/zoom.kcfg b/effects/zoom/zoom.kcfg --- a/effects/zoom/zoom.kcfg +++ b/effects/zoom/zoom.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 1.2 diff --git a/effects/zoom/zoom_config.cpp b/effects/zoom/zoom_config.cpp --- a/effects/zoom/zoom_config.cpp +++ b/effects/zoom/zoom_config.cpp @@ -22,6 +22,7 @@ #include "zoom_config.h" // KConfigSkeleton #include "zoomconfig.h" +#include #include #include @@ -49,6 +50,7 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("zoom")), parent, args) { + ZoomConfig::instance(KWIN_CONFIG); m_ui = new ZoomEffectConfigForm(this); QVBoxLayout* layout = new QVBoxLayout(this); diff --git a/libkwineffects/CMakeLists.txt b/libkwineffects/CMakeLists.txt --- a/libkwineffects/CMakeLists.txt +++ b/libkwineffects/CMakeLists.txt @@ -89,7 +89,7 @@ include_directories(${glinclude}) add_library(${name} SHARED ${kwin_GLUTILSLIB_SRCS}) generate_export_header(${name} BASE_NAME kwinglutils EXPORT_FILE_NAME kwinglutils_export.h) - target_link_libraries(${name} PUBLIC XCB::XCB KF5::CoreAddons KF5::WindowSystem) + target_link_libraries(${name} PUBLIC XCB::XCB KF5::CoreAddons KF5::ConfigCore KF5::WindowSystem) set_target_properties(${name} PROPERTIES VERSION ${KWINEFFECTS_VERSION_STRING} SOVERSION ${KWINEFFECTS_SOVERSION} diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -665,6 +666,14 @@ protected: xcb_connection_t *xcbConnection() const; xcb_window_t x11RootWindow() const; + + /** + * An implementing class can call this with it's kconfig compiled singleton class. + * This method will perform the instance on the class. + * @since 5.9 + **/ + template + void initConfig(); }; @@ -1229,6 +1238,12 @@ **/ virtual void startInteractivePositionSelection(std::function callback) = 0; + /** + * @returns The configuration used by the EffectsHandler. + * @since 5.9 + **/ + virtual KSharedConfigPtr config() const = 0; + Q_SIGNALS: /** * Signal emitted when the current desktop changed. @@ -3355,6 +3370,12 @@ return animationTime(T::duration() != 0 ? T::duration() : defaultDuration); } +template +void Effect::initConfig() +{ + T::instance(effects->config()); +} + } // namespace Q_DECLARE_METATYPE(KWin::EffectWindow*) Q_DECLARE_METATYPE(QList)