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

View file

@ -273,12 +273,26 @@ static ShiftWorkspaceUp* swu;
EffectsHandler::EffectsHandler( Workspace* ws )
{
if( !compositing())
return;
mht = new MakeHalfTransparent;
sm = new ShakyMove;
// gm = new GrowMove;
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 )
{
if( mht )

View file

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

View file

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