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 )
|
void ShakyMoveEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
|
||||||
{
|
{
|
||||||
if( windows.contains( w ))
|
if( windows.contains( w ))
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
effects->prePaintWindow( w, data, time );
|
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 )
|
void WavyWindowsEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
|
||||||
{
|
{
|
||||||
// This window will be transformed by the effect
|
// This window will be transformed by the effect
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
// Check if OpenGL compositing is used
|
// Check if OpenGL compositing is used
|
||||||
// Request the window to be divided into cells which are at most 30x30
|
// Request the window to be divided into cells which are at most 30x30
|
||||||
// pixels big
|
// pixels big
|
||||||
|
|
|
@ -87,7 +87,7 @@ void DesktopGridEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& dat
|
||||||
if( w->isOnAllDesktops())
|
if( w->isOnAllDesktops())
|
||||||
{
|
{
|
||||||
if( slide_painting_sticky )
|
if( slide_painting_sticky )
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
else
|
else
|
||||||
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
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 );
|
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
||||||
if( w == window_move )
|
if( w == window_move )
|
||||||
{
|
{
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
if( w->isOnAllDesktops() && painting_desktop != posToDesktop( window_move_pos - window_move_diff ))
|
if( w->isOnAllDesktops() && painting_desktop != posToDesktop( window_move_pos - window_move_diff ))
|
||||||
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ void DrunkenEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, i
|
||||||
{
|
{
|
||||||
windows[ w ] += time / 1000.;
|
windows[ w ] += time / 1000.;
|
||||||
if( windows[ w ] < 1 )
|
if( windows[ w ] < 1 )
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
else
|
else
|
||||||
windows.remove( w );
|
windows.remove( w );
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ void ExplosionEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data,
|
||||||
if( mWindows[ w ] < 1 )
|
if( mWindows[ w ] < 1 )
|
||||||
{
|
{
|
||||||
data.setTranslucent();
|
data.setTranslucent();
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
|
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -32,7 +32,7 @@ void FallApartEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data,
|
||||||
if( windows[ w ] < 1 )
|
if( windows[ w ] < 1 )
|
||||||
{
|
{
|
||||||
windows[ w ] += time / 1000.;
|
windows[ w ] += time / 1000.;
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
|
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
|
||||||
// Request the window to be divided into cells
|
// Request the window to be divided into cells
|
||||||
data.quads = data.quads.makeGrid( 40 );
|
data.quads = data.quads.makeGrid( 40 );
|
||||||
|
|
|
@ -32,7 +32,7 @@ void FlameEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int
|
||||||
if( windows[ w ] < 1 )
|
if( windows[ w ] < 1 )
|
||||||
{
|
{
|
||||||
windows[ w ] += time / 500.;
|
windows[ w ] += time / 500.;
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
|
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
|
||||||
data.quads = data.quads.splitAtY( windows[ w ] * w->height());
|
data.quads = data.quads.splitAtY( windows[ w ] * w->height());
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ void MinimizeAnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintDat
|
||||||
if( mAnimationProgress.contains( w ))
|
if( mAnimationProgress.contains( w ))
|
||||||
{
|
{
|
||||||
// We'll transform this window
|
// We'll transform this window
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE );
|
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -101,7 +101,7 @@ void PresentWindowsEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData&
|
||||||
if( mWindowData.contains(w) )
|
if( mWindowData.contains(w) )
|
||||||
{
|
{
|
||||||
// This window will be transformed by the effect
|
// 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_MINIMIZE );
|
||||||
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
|
||||||
// If it's minimized window or on another desktop and effect is not
|
// 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
|
windows[ w ] += time / 500.; // complete change in 500ms
|
||||||
if( windows[ w ] < 1 )
|
if( windows[ w ] < 1 )
|
||||||
data.mask |= PAINT_WINDOW_TRANSFORMED;
|
data.setTransformed();
|
||||||
else
|
else
|
||||||
windows.remove( w );
|
windows.remove( w );
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,12 @@ void WindowPrePaintData::setTranslucent()
|
||||||
clip = QRegion(); // cannot clip, will be transparent
|
clip = QRegion(); // cannot clip, will be transparent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowPrePaintData::setTransformed()
|
||||||
|
{
|
||||||
|
mask |= Effect::PAINT_WINDOW_TRANSFORMED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WindowPaintData::WindowPaintData()
|
WindowPaintData::WindowPaintData()
|
||||||
: opacity( 1.0 )
|
: opacity( 1.0 )
|
||||||
, contents_opacity( 1.0 )
|
, contents_opacity( 1.0 )
|
||||||
|
|
|
@ -434,10 +434,14 @@ class KWIN_EXPORT WindowPrePaintData
|
||||||
QRegion clip;
|
QRegion clip;
|
||||||
WindowQuadList quads;
|
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.
|
* Takes also care of changing the regions.
|
||||||
*/
|
*/
|
||||||
void setTranslucent();
|
void setTranslucent();
|
||||||
|
/**
|
||||||
|
* Helper to mark that this window will be transformed
|
||||||
|
**/
|
||||||
|
void setTransformed();
|
||||||
};
|
};
|
||||||
|
|
||||||
class KWIN_EXPORT WindowPaintData
|
class KWIN_EXPORT WindowPaintData
|
||||||
|
|
Loading…
Reference in a new issue