Add setTransformed() helper method
svn path=/trunk/KDE/kdebase/workspace/; revision=689913
This commit is contained in:
parent
96aba51960
commit
7273d0ddb5
12 changed files with 22 additions and 12 deletions
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue