Make WindowPaintData ctor require an EffectWindow argument,
which is used to fill it in. Makes thumbnails work again. svn path=/trunk/KDE/kdebase/workspace/; revision=697961
This commit is contained in:
parent
ecb89e482e
commit
30eb55863c
9 changed files with 43 additions and 24 deletions
20
effects.cpp
20
effects.cpp
|
@ -877,16 +877,6 @@ void EffectWindowImpl::unrefWindow()
|
|||
abort(); // TODO
|
||||
}
|
||||
|
||||
const Toplevel* EffectWindowImpl::window() const
|
||||
{
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
Toplevel* EffectWindowImpl::window()
|
||||
{
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
void EffectWindowImpl::setWindow( Toplevel* w )
|
||||
{
|
||||
toplevel = w;
|
||||
|
@ -897,11 +887,6 @@ void EffectWindowImpl::setSceneWindow( Scene::Window* w )
|
|||
sw = w;
|
||||
}
|
||||
|
||||
Scene::Window* EffectWindowImpl::sceneWindow()
|
||||
{
|
||||
return sw;
|
||||
}
|
||||
|
||||
int EffectWindowImpl::x() const
|
||||
{
|
||||
return toplevel->x();
|
||||
|
@ -1097,6 +1082,11 @@ void EffectWindowImpl::setShader(GLShader* shader)
|
|||
abort(); // TODO
|
||||
}
|
||||
|
||||
WindowQuadList EffectWindowImpl::buildQuads() const
|
||||
{
|
||||
return sceneWindow()->buildQuads();
|
||||
}
|
||||
|
||||
EffectWindow* effectWindow( Toplevel* w )
|
||||
{
|
||||
EffectWindowImpl* ret = w->effectWindow();
|
||||
|
|
26
effects.h
26
effects.h
|
@ -191,12 +191,14 @@ class EffectWindowImpl : public EffectWindow
|
|||
virtual EffectWindowList mainWindows() const;
|
||||
|
||||
virtual void setShader(GLShader* shader);
|
||||
virtual WindowQuadList buildQuads() const;
|
||||
|
||||
const Toplevel* window() const;
|
||||
Toplevel* window();
|
||||
|
||||
void setWindow( Toplevel* w ); // internal
|
||||
void setSceneWindow( Scene::Window* w ); // internal
|
||||
const Scene::Window* sceneWindow() const; // internal
|
||||
Scene::Window* sceneWindow(); // internal
|
||||
private:
|
||||
Toplevel* toplevel;
|
||||
|
@ -230,6 +232,30 @@ EffectWindowGroupImpl::EffectWindowGroupImpl( Group* g )
|
|||
EffectWindow* effectWindow( Toplevel* w );
|
||||
EffectWindow* effectWindow( Scene::Window* w );
|
||||
|
||||
inline
|
||||
const Scene::Window* EffectWindowImpl::sceneWindow() const
|
||||
{
|
||||
return sw;
|
||||
}
|
||||
|
||||
inline
|
||||
Scene::Window* EffectWindowImpl::sceneWindow()
|
||||
{
|
||||
return sw;
|
||||
}
|
||||
|
||||
inline
|
||||
const Toplevel* EffectWindowImpl::window() const
|
||||
{
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
inline
|
||||
Toplevel* EffectWindowImpl::window()
|
||||
{
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
|
|
@ -500,7 +500,7 @@ void BoxSwitchEffect::paintWindowThumbnail( EffectWindow* w )
|
|||
{
|
||||
if( !windows.contains( w ))
|
||||
return;
|
||||
WindowPaintData data;
|
||||
WindowPaintData data( w );
|
||||
|
||||
setPositionTransformations( data,
|
||||
windows[ w ]->thumbnail, w,
|
||||
|
|
|
@ -56,7 +56,7 @@ void TaskbarThumbnailEffect::postPaintScreen()
|
|||
foreach( EffectWindow* w, mThumbnails )
|
||||
{
|
||||
QRect thumb = getThumbnailPosition( w, &space);
|
||||
WindowPaintData thumbdata;
|
||||
WindowPaintData thumbdata( w );
|
||||
thumbdata.xTranslate = thumb.x() - w->x();
|
||||
thumbdata.yTranslate = thumb.y() - w->y();
|
||||
thumbdata.xScale = thumb.width() / (float)w->width();
|
||||
|
|
|
@ -32,7 +32,7 @@ void TestThumbnailEffect::paintScreen( int mask, QRegion region, ScreenPaintData
|
|||
effects->paintScreen( mask, region, data );
|
||||
if( active_window != NULL && region.contains( thumbnailRect()))
|
||||
{
|
||||
WindowPaintData data;
|
||||
WindowPaintData data( active_window );
|
||||
QRect region;
|
||||
setPositionTransformations( data, region, active_window, thumbnailRect(), Qt::KeepAspectRatio );
|
||||
effects->drawWindow( active_window,
|
||||
|
|
|
@ -38,7 +38,7 @@ void ThumbnailAsideEffect::paintScreen( int mask, QRegion region, ScreenPaintDat
|
|||
{
|
||||
if( region.contains( d.rect ))
|
||||
{
|
||||
WindowPaintData data;
|
||||
WindowPaintData data( d.window );
|
||||
data.opacity = opacity;
|
||||
QRect region;
|
||||
setPositionTransformations( data, region, d.window, d.rect, Qt::KeepAspectRatio );
|
||||
|
|
|
@ -35,8 +35,8 @@ void WindowPrePaintData::setTransformed()
|
|||
}
|
||||
|
||||
|
||||
WindowPaintData::WindowPaintData()
|
||||
: opacity( 1.0 )
|
||||
WindowPaintData::WindowPaintData( EffectWindow* w )
|
||||
: opacity( w->opacity())
|
||||
, contents_opacity( 1.0 )
|
||||
, decoration_opacity( 1.0 )
|
||||
, xScale( 1 )
|
||||
|
@ -46,6 +46,7 @@ WindowPaintData::WindowPaintData()
|
|||
, saturation( 1 )
|
||||
, brightness( 1 )
|
||||
{
|
||||
quads = w->buildQuads();
|
||||
}
|
||||
|
||||
ScreenPaintData::ScreenPaintData()
|
||||
|
|
|
@ -346,6 +346,9 @@ class KWIN_EXPORT EffectWindow
|
|||
virtual EffectWindowList mainWindows() const = 0;
|
||||
|
||||
virtual void setShader(GLShader* shader) = 0;
|
||||
|
||||
// TODO internal?
|
||||
virtual WindowQuadList buildQuads() const = 0;
|
||||
};
|
||||
|
||||
class KWIN_EXPORT EffectWindowGroup
|
||||
|
@ -450,7 +453,7 @@ class KWIN_EXPORT WindowPrePaintData
|
|||
class KWIN_EXPORT WindowPaintData
|
||||
{
|
||||
public:
|
||||
WindowPaintData();
|
||||
WindowPaintData( EffectWindow* w );
|
||||
/**
|
||||
* Window opacity, in range 0 = transparent to 1 = fully opaque
|
||||
* Opacity for contents is opacity*contents_opacity, the same
|
||||
|
|
|
@ -267,8 +267,7 @@ void Scene::paintSimpleScreen( int orig_mask, QRegion region )
|
|||
|
||||
void Scene::paintWindow( Window* w, int mask, QRegion region, WindowQuadList quads )
|
||||
{
|
||||
WindowPaintData data;
|
||||
data.opacity = w->window()->opacity();
|
||||
WindowPaintData data( w->window()->effectWindow());
|
||||
data.quads = quads;
|
||||
w->prepareForPainting();
|
||||
effects->paintWindow( effectWindow( w ), mask, region, data );
|
||||
|
|
Loading…
Reference in a new issue