diff --git a/src/plugins/blur/blur.cpp b/src/plugins/blur/blur.cpp index 9a3e19f481..db1409ca5d 100644 --- a/src/plugins/blur/blur.cpp +++ b/src/plugins/blur/blur.cpp @@ -334,9 +334,9 @@ void BlurEffect::updateBlurRegion(EffectWindow *w) } if (valid) { - blurRegions[w] = region; + m_windows[w].region = region; } else { - blurRegions.remove(w); + m_windows.remove(w); } } @@ -361,7 +361,7 @@ void BlurEffect::slotWindowAdded(EffectWindow *w) void BlurEffect::slotWindowDeleted(EffectWindow *w) { - blurRegions.remove(w); + m_windows.remove(w); auto it = windowBlurChangedConnections.find(w); if (it == windowBlurChangedConnections.end()) { return; @@ -471,12 +471,12 @@ QRegion BlurEffect::expand(const QRegion ®ion) const return expanded; } -QRegion BlurEffect::blurRegion(const EffectWindow *w) const +QRegion BlurEffect::blurRegion(EffectWindow *w) const { QRegion region; - if (auto it = blurRegions.find(w); it != blurRegions.end()) { - const QRegion &appRegion = *it; + if (auto it = m_windows.find(w); it != m_windows.end()) { + const QRegion &appRegion = it->region; if (!appRegion.isEmpty()) { if (w->decorationHasAlpha() && decorationSupportsBlurBehind(w)) { region = decorationBlurRegion(w); diff --git a/src/plugins/blur/blur.h b/src/plugins/blur/blur.h index 9ca5f607ba..78fb789225 100644 --- a/src/plugins/blur/blur.h +++ b/src/plugins/blur/blur.h @@ -27,6 +27,11 @@ static const int borderSize = 5; class BlurShader; +struct BlurData +{ + QRegion region; +}; + class BlurEffect : public KWin::Effect { Q_OBJECT @@ -78,7 +83,7 @@ private: QRegion expand(const QRegion ®ion) const; void initBlurStrengthValues(); bool updateTexture(EffectScreen *screen, const RenderTarget &renderTarget); - QRegion blurRegion(const EffectWindow *w) const; + QRegion blurRegion(EffectWindow *w) const; QRegion decorationBlurRegion(const EffectWindow *w) const; bool decorationSupportsBlurBehind(const EffectWindow *w) const; bool shouldBlur(const EffectWindow *w, int mask, const WindowPaintData &data) const; @@ -132,7 +137,7 @@ private: QVector blurStrengthValues; QMap windowBlurChangedConnections; - QMap blurRegions; + QHash m_windows; static KWaylandServer::BlurManagerInterface *s_blurManager; static QTimer *s_blurManagerRemoveTimer;