From 1f167d8d15df71ba2b30fbf82e2b27aad5097e7d Mon Sep 17 00:00:00 2001 From: Rivo Laks Date: Fri, 30 Mar 2007 16:12:07 +0000 Subject: [PATCH] Add EffectWindow::isDeleted() method. Don't draw shadow for deleted windows. svn path=/branches/work/kwin_composite/; revision=648149 --- effects.cpp | 6 ++++++ effects.h | 1 + effects/shadow.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/effects.cpp b/effects.cpp index 90a251c1b1..890e9b61fb 100644 --- a/effects.cpp +++ b/effects.cpp @@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms. #include "client.h" #include "scene.h" #include "options.h" +#include "deleted.h" #include "effects/boxswitch.h" #include "effects/demo_taskbarthumbnail.h" @@ -621,4 +622,9 @@ bool EffectWindow::isOnDesktop( int d ) const return desktop() == d || isOnAllDesktops(); } +bool EffectWindow::isDeleted() const +{ + return (dynamic_cast( toplevel ) != 0); +} + } // namespace diff --git a/effects.h b/effects.h index 6647a6e255..f0d36bd1f7 100644 --- a/effects.h +++ b/effects.h @@ -201,6 +201,7 @@ class EffectWindow Toplevel* window(); void enablePainting( int reason ); void disablePainting( int reason ); + bool isDeleted() const; bool isOnDesktop( int d ) const; bool isOnCurrentDesktop() const; bool isOnAllDesktops() const; diff --git a/effects/shadow.cpp b/effects/shadow.cpp index 90a61b30ed..b788e9436a 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -32,7 +32,8 @@ void ShadowEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, Q void ShadowEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ) { - drawShadow( w, mask, region, data ); + if( !w->isDeleted() ) + drawShadow( w, mask, region, data ); effects->paintWindow( w, mask, region, data ); }