From 8d0f15e6555d04a1c99e2d74630ad04df886ea3e Mon Sep 17 00:00:00 2001 From: Philip Falkner Date: Sun, 11 Feb 2007 17:38:56 +0000 Subject: [PATCH] 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 --- effects.cpp | 10 ++++++++++ effects.h | 2 ++ events.cpp | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/effects.cpp b/effects.cpp index 9c22c2970d..bae4d44236 100644 --- a/effects.cpp +++ b/effects.cpp @@ -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 ) diff --git a/effects.h b/effects.h index f18396690d..57b54ce7f3 100644 --- a/effects.h +++ b/effects.h @@ -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 ); diff --git a/events.cpp b/events.cpp index 5c71f64198..40944081e4 100644 --- a/events.cpp +++ b/events.cpp @@ -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)