Hook up windowOpacityChanged for effects. Note that this only affects when the window opacity atom is changed; if an effect alters data.opacity in WindowPaintData, no notification will happen.

svn path=/branches/work/kwin_composite/; revision=632582
This commit is contained in:
Philip Falkner 2007-02-11 17:38:56 +00:00
parent c16656d66d
commit 8d0f15e655
3 changed files with 16 additions and 0 deletions

View file

@ -47,6 +47,10 @@ void Effect::windowUserMovedResized( EffectWindow* , bool, bool )
{
}
void Effect::windowOpacityChanged( EffectWindow* )
{
}
void Effect::windowAdded( EffectWindow* )
{
}
@ -162,6 +166,12 @@ void EffectsHandler::windowUserMovedResized( EffectWindow* c, bool first, bool l
ep.second->windowUserMovedResized( c, first, last );
}
void EffectsHandler::windowOpacityChanged( EffectWindow* c )
{
foreach( EffectPair ep, loaded_effects )
ep.second->windowOpacityChanged( c );
}
void EffectsHandler::windowAdded( EffectWindow* c )
{
foreach( EffectPair ep, loaded_effects )

View file

@ -73,6 +73,7 @@ class Effect
virtual void postPaintWindow( EffectWindow* w );
// called when moved/resized or once after it's finished
virtual void windowUserMovedResized( EffectWindow* c, bool first, bool last );
virtual void windowOpacityChanged( EffectWindow* c );
virtual void windowAdded( EffectWindow* c );
virtual void windowClosed( EffectWindow* c );
virtual void windowDeleted( EffectWindow* c );
@ -137,6 +138,7 @@ class EffectsHandler
// internal (used by kwin core or compositing code)
void startPaint();
void windowUserMovedResized( EffectWindow* c, bool first, bool last );
void windowOpacityChanged( EffectWindow* c );
void windowAdded( EffectWindow* c );
void windowClosed( EffectWindow* c );
void windowDeleted( EffectWindow* c );

View file

@ -597,6 +597,8 @@ bool Client::windowEvent( XEvent* e )
{
addDamageFull();
scene->windowOpacityChanged( this );
if( effects )
effects->windowOpacityChanged( effectWindow());
}
else
{ // forward to the frame if there's possibly another compositing manager running
@ -1606,6 +1608,8 @@ bool Unmanaged::windowEvent( XEvent* e )
if( dirty[ NETWinInfo::PROTOCOLS2 ] & NET::WM2Opacity )
{
scene->windowOpacityChanged( this );
if( effects )
effects->windowOpacityChanged( effectWindow());
addDamageFull();
}
switch (e->type)