diff --git a/lanczosfilter.cpp b/lanczosfilter.cpp index 35999e9f3c..eaeba2c4e2 100644 --- a/lanczosfilter.cpp +++ b/lanczosfilter.cpp @@ -20,7 +20,10 @@ along with this program. If not, see . *********************************************************************/ #include "lanczosfilter.h" +#include "client.h" +#include "deleted.h" #include "effects.h" +#include "unmanaged.h" #include "options.h" #include @@ -388,15 +391,27 @@ void LanczosFilter::timerEvent(QTimerEvent *event) delete m_offscreenTex; m_offscreenTarget = 0; m_offscreenTex = 0; - foreach (EffectWindow * w, effects->stackingOrder()) { - QVariant cachedTextureVariant = w->data(LanczosCacheRole); - if (cachedTextureVariant.isValid()) { - GLTexture *cachedTexture = static_cast< GLTexture*>(cachedTextureVariant.value()); - delete cachedTexture; - cachedTexture = 0; - w->setData(LanczosCacheRole, QVariant()); - } + foreach (Client *c, Workspace::self()->clientList()) { + discardCacheTexture(c->effectWindow()); } + foreach (Client *c, Workspace::self()->desktopList()) { + discardCacheTexture(c->effectWindow()); + } + foreach (Unmanaged *u, Workspace::self()->unmanagedList()) { + discardCacheTexture(u->effectWindow()); + } + foreach (Deleted *d, Workspace::self()->deletedList()) { + discardCacheTexture(d->effectWindow()); + } + } +} + +void LanczosFilter::discardCacheTexture(EffectWindow *w) +{ + QVariant cachedTextureVariant = w->data(LanczosCacheRole); + if (cachedTextureVariant.isValid()) { + delete static_cast< GLTexture*>(cachedTextureVariant.value()); + w->setData(LanczosCacheRole, QVariant()); } } diff --git a/lanczosfilter.h b/lanczosfilter.h index 538220da6f..12a844ee8c 100644 --- a/lanczosfilter.h +++ b/lanczosfilter.h @@ -33,6 +33,7 @@ along with this program. If not, see . namespace KWin { +class EffectWindow; class EffectWindowImpl; class WindowPaintData; class GLTexture; @@ -55,6 +56,7 @@ private: void init(); void updateOffscreenSurfaces(); void setUniforms(); + void discardCacheTexture(EffectWindow *w); void createKernel(float delta, int *kernelSize); void createOffsets(int count, float width, Qt::Orientation direction);