diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp index 7dd895d07b..8e3c0e7758 100644 --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -28,6 +28,17 @@ namespace KWin KWIN_EFFECT( fallapart, FallApartEffect ) +FallApartEffect::FallApartEffect() + { + reconfigure( ReconfigureAll ); + } + +void FallApartEffect::reconfigure( ReconfigureFlags ) + { + KConfigGroup conf = effects->effectConfig( "FallApart" ); + blockSize = qBound( 1, conf.readEntry( "BlockSize", 40 ), 100000 ); + } + void FallApartEffect::prePaintScreen( ScreenPrePaintData& data, int time ) { if( !windows.isEmpty()) @@ -45,7 +56,7 @@ void FallApartEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE ); // Request the window to be divided into cells - data.quads = data.quads.makeGrid( 40 ); + data.quads = data.quads.makeGrid( blockSize ); } else { diff --git a/effects/fallapart/fallapart.h b/effects/fallapart/fallapart.h index 24e988c197..5bdce5e242 100644 --- a/effects/fallapart/fallapart.h +++ b/effects/fallapart/fallapart.h @@ -30,6 +30,8 @@ class FallApartEffect : public Effect { public: + FallApartEffect(); + virtual void reconfigure( ReconfigureFlags ); virtual void prePaintScreen( ScreenPrePaintData& data, int time ); virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ); virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); @@ -39,7 +41,7 @@ class FallApartEffect private: QHash< const EffectWindow*, double > windows; bool isRealWindow ( EffectWindow* w ); - + int blockSize; }; } // namespace