No effects when not compositing.

svn path=/branches/work/kwin_composite/; revision=560594
This commit is contained in:
Luboš Luňák 2006-07-10 18:34:57 +00:00
parent 64bf5bc51e
commit 03fedc56dd
4 changed files with 20 additions and 3 deletions

View file

@ -12,6 +12,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include "workspace.h" #include "workspace.h"
#include "client.h" #include "client.h"
#include "unmanaged.h" #include "unmanaged.h"
#include "effects.h"
#include "scene.h" #include "scene.h"
#include "scene_basic.h" #include "scene_basic.h"
#include "scene_xrender.h" #include "scene_xrender.h"
@ -36,6 +37,7 @@ void Workspace::setupCompositing()
XCompositeRedirectSubwindows( display(), rootWindow(), CompositeRedirectManual ); XCompositeRedirectSubwindows( display(), rootWindow(), CompositeRedirectManual );
// scene = new SceneBasic( this ); // scene = new SceneBasic( this );
scene = new SceneXrender( this ); scene = new SceneXrender( this );
effects = new EffectsHandler( this );
addDamage( 0, 0, displayWidth(), displayHeight()); addDamage( 0, 0, displayWidth(), displayHeight());
foreach( Client* c, clients ) foreach( Client* c, clients )
c->setupCompositing(); c->setupCompositing();
@ -53,6 +55,8 @@ void Workspace::finishCompositing()
c->finishCompositing(); c->finishCompositing();
XCompositeUnredirectSubwindows( display(), rootWindow(), CompositeRedirectManual ); XCompositeUnredirectSubwindows( display(), rootWindow(), CompositeRedirectManual );
compositeTimer.stop(); compositeTimer.stop();
delete effects;
effects = NULL;
delete scene; delete scene;
scene = NULL; scene = NULL;
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.begin();

View file

@ -273,11 +273,25 @@ static ShiftWorkspaceUp* swu;
EffectsHandler::EffectsHandler( Workspace* ws ) EffectsHandler::EffectsHandler( Workspace* ws )
{ {
if( !compositing())
return;
mht = new MakeHalfTransparent; mht = new MakeHalfTransparent;
sm = new ShakyMove; sm = new ShakyMove;
// gm = new GrowMove; // gm = new GrowMove;
swu = new ShiftWorkspaceUp( ws ); swu = new ShiftWorkspaceUp( ws );
} }
EffectsHandler::~EffectsHandler()
{
delete mht;
mht = NULL;
delete sm;
sm = NULL;
delete gm;
gm = NULL;
delete swu;
swu = NULL;
}
void EffectsHandler::windowUserMovedResized( Toplevel* c, bool first, bool last ) void EffectsHandler::windowUserMovedResized( Toplevel* c, bool first, bool last )
{ {

View file

@ -80,6 +80,7 @@ class EffectsHandler
{ {
public: public:
EffectsHandler( Workspace* ws ); EffectsHandler( Workspace* ws );
~EffectsHandler();
void windowUserMovedResized( Toplevel* c, bool first, bool last ); void windowUserMovedResized( Toplevel* c, bool first, bool last );
void windowDeleted( Toplevel* c ); void windowDeleted( Toplevel* c );
void transformWindow( Toplevel* c, Matrix& m, EffectData& data ); void transformWindow( Toplevel* c, Matrix& m, EffectData& data );

View file

@ -122,9 +122,7 @@ Application::Application( )
initting = false; // TODO initting = false; // TODO
// create workspace. // create workspace.
Workspace* workspace = new Workspace( isSessionRestored() ); (void) new Workspace( isSessionRestored() );
effects = new EffectsHandler( workspace );
syncX(); // trigger possible errors, there's still a chance to abort syncX(); // trigger possible errors, there's still a chance to abort