From ee9e4ad7151263b5c42a205afd6938837354c214 Mon Sep 17 00:00:00 2001 From: Philip Falkner Date: Fri, 12 Jan 2007 23:23:41 +0000 Subject: [PATCH] Allow effects on window minimize and unminimize. svn path=/branches/work/kwin_composite/; revision=622778 --- client.cpp | 5 +++++ effects.cpp | 20 ++++++++++++++++++++ effects.h | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/client.cpp b/client.cpp index e3a4f51590..c41acff764 100644 --- a/client.cpp +++ b/client.cpp @@ -29,6 +29,7 @@ License. See the file "COPYING" for the exact licensing terms. #include "notifications.h" #include "rules.h" #include "scene.h" +#include "effects.h" #include #include @@ -556,6 +557,8 @@ void Client::minimize( bool avoid_animation ) workspace()->updateMinimizedOfTransients( this ); updateWindowRules(); workspace()->updateFocusChains( this, Workspace::FocusChainMakeLast ); + if( effects ) + effects->windowMinimized( this ); } void Client::unminimize( bool avoid_animation ) @@ -574,6 +577,8 @@ void Client::unminimize( bool avoid_animation ) updateAllowedActions(); workspace()->updateMinimizedOfTransients( this ); updateWindowRules(); + if( effects ) + effects->windowUnminimized( this ); } extern bool blockAnimation; diff --git a/effects.cpp b/effects.cpp index 9779d5613e..8852c93a43 100644 --- a/effects.cpp +++ b/effects.cpp @@ -53,6 +53,14 @@ void Effect::windowActivated( Toplevel* ) { } +void Effect::windowMinimized( Toplevel* ) + { + } + +void Effect::windowUnminimized( Toplevel* ) + { + } + void Effect::windowInputMouseEvent( Window, QEvent* ) { } @@ -143,6 +151,18 @@ void EffectsHandler::windowActivated( Toplevel* c ) e->windowActivated( c ); } +void EffectsHandler::windowMinimized( Toplevel* c ) + { + foreach( Effect* e, effects ) + e->windowMinimized( c ); + } + +void EffectsHandler::windowUnminimized( Toplevel* c ) + { + foreach( Effect* e, effects ) + e->windowUnminimized( c ); + } + // start another painting pass void EffectsHandler::startPaint() { diff --git a/effects.h b/effects.h index 27e516b37e..ea7369bde5 100644 --- a/effects.h +++ b/effects.h @@ -75,6 +75,8 @@ class Effect virtual void windowAdded( Toplevel* c ); virtual void windowDeleted( Toplevel* c ); virtual void windowActivated( Toplevel* c ); + virtual void windowMinimized( Toplevel* c ); + virtual void windowUnminimized( Toplevel* c ); virtual void windowInputMouseEvent( Window w, QEvent* e ); // Interpolates between x and y @@ -110,6 +112,8 @@ class EffectsHandler void windowAdded( Toplevel* c ); void windowDeleted( Toplevel* c ); void windowActivated( Toplevel* c ); + void windowMinimized( Toplevel* c ); + void windowUnminimized( Toplevel* c ); bool checkInputWindowEvent( XEvent* e ); void checkInputWindowStacking(); private: