diff --git a/effects/demo_shakymove.cpp b/effects/demo_shakymove.cpp index 090bc24cbc..a3a7a2e15e 100644 --- a/effects/demo_shakymove.cpp +++ b/effects/demo_shakymove.cpp @@ -33,7 +33,7 @@ void ShakyMoveEffect::prePaintScreen( ScreenPrePaintData& data, int time ) void ShakyMoveEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ) { if( windows.contains( w )) - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); effects->prePaintWindow( w, data, time ); } diff --git a/effects/demo_wavywindows.cpp b/effects/demo_wavywindows.cpp index d6813978d3..774af8f3f3 100644 --- a/effects/demo_wavywindows.cpp +++ b/effects/demo_wavywindows.cpp @@ -39,7 +39,7 @@ void WavyWindowsEffect::prePaintScreen( ScreenPrePaintData& data, int time ) void WavyWindowsEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ) { // This window will be transformed by the effect - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); // Check if OpenGL compositing is used // Request the window to be divided into cells which are at most 30x30 // pixels big diff --git a/effects/desktopgrid.cpp b/effects/desktopgrid.cpp index 6a233a4456..66652c1303 100644 --- a/effects/desktopgrid.cpp +++ b/effects/desktopgrid.cpp @@ -87,7 +87,7 @@ void DesktopGridEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& dat if( w->isOnAllDesktops()) { if( slide_painting_sticky ) - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); else w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP ); } @@ -104,7 +104,7 @@ void DesktopGridEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& dat w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP ); if( w == window_move ) { - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); if( w->isOnAllDesktops() && painting_desktop != posToDesktop( window_move_pos - window_move_diff )) w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP ); } diff --git a/effects/drunken.cpp b/effects/drunken.cpp index cb8ef6ebdc..05287e9ab5 100644 --- a/effects/drunken.cpp +++ b/effects/drunken.cpp @@ -30,7 +30,7 @@ void DrunkenEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, i { windows[ w ] += time / 1000.; if( windows[ w ] < 1 ) - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); else windows.remove( w ); } diff --git a/effects/explosioneffect.cpp b/effects/explosioneffect.cpp index 6a647688d0..5751b01234 100644 --- a/effects/explosioneffect.cpp +++ b/effects/explosioneffect.cpp @@ -122,7 +122,7 @@ void ExplosionEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, if( mWindows[ w ] < 1 ) { data.setTranslucent(); - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE ); } else diff --git a/effects/fallapart.cpp b/effects/fallapart.cpp index 2e1e09e10f..beee4717af 100644 --- a/effects/fallapart.cpp +++ b/effects/fallapart.cpp @@ -32,7 +32,7 @@ void FallApartEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, if( windows[ w ] < 1 ) { windows[ w ] += time / 1000.; - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE ); // Request the window to be divided into cells data.quads = data.quads.makeGrid( 40 ); diff --git a/effects/flame.cpp b/effects/flame.cpp index d875123bd6..5e2da48cc5 100644 --- a/effects/flame.cpp +++ b/effects/flame.cpp @@ -32,7 +32,7 @@ void FlameEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int if( windows[ w ] < 1 ) { windows[ w ] += time / 500.; - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE ); data.quads = data.quads.splitAtY( windows[ w ] * w->height()); } diff --git a/effects/minimizeanimation.cpp b/effects/minimizeanimation.cpp index d9365597a2..0862e4fab3 100644 --- a/effects/minimizeanimation.cpp +++ b/effects/minimizeanimation.cpp @@ -55,7 +55,7 @@ void MinimizeAnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintDat if( mAnimationProgress.contains( w )) { // We'll transform this window - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE ); } else diff --git a/effects/presentwindows.cpp b/effects/presentwindows.cpp index 63abbc0592..199d4c5243 100644 --- a/effects/presentwindows.cpp +++ b/effects/presentwindows.cpp @@ -101,7 +101,7 @@ void PresentWindowsEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& if( mWindowData.contains(w) ) { // This window will be transformed by the effect - data.mask |= Effect::PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE ); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP ); // If it's minimized window or on another desktop and effect is not diff --git a/effects/scalein.cpp b/effects/scalein.cpp index 4572ec439f..c8ebbf42db 100644 --- a/effects/scalein.cpp +++ b/effects/scalein.cpp @@ -28,7 +28,7 @@ void ScaleInEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, i { windows[ w ] += time / 500.; // complete change in 500ms if( windows[ w ] < 1 ) - data.mask |= PAINT_WINDOW_TRANSFORMED; + data.setTransformed(); else windows.remove( w ); } diff --git a/lib/kwineffects.cpp b/lib/kwineffects.cpp index 2ae9b86892..29d0bb6eea 100644 --- a/lib/kwineffects.cpp +++ b/lib/kwineffects.cpp @@ -29,6 +29,12 @@ void WindowPrePaintData::setTranslucent() clip = QRegion(); // cannot clip, will be transparent } +void WindowPrePaintData::setTransformed() + { + mask |= Effect::PAINT_WINDOW_TRANSFORMED; + } + + WindowPaintData::WindowPaintData() : opacity( 1.0 ) , contents_opacity( 1.0 ) diff --git a/lib/kwineffects.h b/lib/kwineffects.h index 91e7b0e5aa..85b0b7dcd4 100644 --- a/lib/kwineffects.h +++ b/lib/kwineffects.h @@ -434,10 +434,14 @@ class KWIN_EXPORT WindowPrePaintData QRegion clip; WindowQuadList quads; /** - * Simple helper than sets data to say the window will be painted as non-opaque. + * Simple helper that sets data to say the window will be painted as non-opaque. * Takes also care of changing the regions. */ void setTranslucent(); + /** + * Helper to mark that this window will be transformed + **/ + void setTransformed(); }; class KWIN_EXPORT WindowPaintData