diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index ae9f37326..039f7a72c 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -46,14 +46,7 @@ BlurEffect::BlurEffect() qCDebug(KWINEFFECTS) << "Simple blur shader failed to load"; } - // Offscreen texture that's used as the target for the horizontal blur pass - // and the source for the vertical pass. - tex = GLTexture(GL_RGBA8, effects->virtualScreenSize()); - tex.setFilter(GL_LINEAR); - tex.setWrapMode(GL_CLAMP_TO_EDGE); - - target = new GLRenderTarget(tex); - + updateTexture(); reconfigure(ReconfigureAll); // ### Hackish way to announce support. @@ -83,6 +76,7 @@ BlurEffect::~BlurEffect() { windows.clear(); + qDebug() << "deleting blur mangler"; delete m_simpleShader; delete shader; delete target; @@ -90,7 +84,21 @@ BlurEffect::~BlurEffect() void BlurEffect::slotScreenGeometryChanged() { - effects->reloadEffect(this); + updateTexture(); + // Fetch the blur regions for all windows + foreach (EffectWindow *window, effects->stackingOrder()) + updateBlurRegion(window); +} + +void BlurEffect::updateTexture() { + delete target; + // Offscreen texture that's used as the target for the horizontal blur pass + // and the source for the vertical pass. + tex = GLTexture(GL_RGBA8, effects->virtualScreenSize()); + tex.setFilter(GL_LINEAR); + tex.setWrapMode(GL_CLAMP_TO_EDGE); + + target = new GLRenderTarget(tex); } void BlurEffect::reconfigure(ReconfigureFlags flags) @@ -108,6 +116,7 @@ void BlurEffect::reconfigure(ReconfigureFlags flags) if (!shader || !shader->isValid()) { effects->removeSupportProperty(s_blurAtomName, this); + qDebug() << "deleting blur mangler2" << shader; delete m_blurManager; m_blurManager = nullptr; } diff --git a/effects/blur/blur.h b/effects/blur/blur.h index e6f44946d..e3023f8db 100644 --- a/effects/blur/blur.h +++ b/effects/blur/blur.h @@ -76,6 +76,7 @@ public Q_SLOTS: void slotScreenGeometryChanged(); private: + void updateTexture(); QRect expand(const QRect &rect) const; QRegion expand(const QRegion ®ion) const; QRegion blurRegion(const EffectWindow *w) const;