From 601243e5492080ead57884f5a2ba10a2ac021a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 7 May 2012 22:29:54 +0200 Subject: [PATCH] handle m_currentBuildQuadsIterator validation independent form painting pass issue is that the effect chain may (will) change between two paint passes and buildQuads is called outside the paint pass (shadows / decos whatever changes) so that the iterator may dangle BUG: 299582 FIXED-IN: 4.9 REVIEW: 104881 --- effects.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/effects.cpp b/effects.cpp index 9cbf387e32..743bb9c607 100644 --- a/effects.cpp +++ b/effects.cpp @@ -307,10 +307,17 @@ void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, QRegion region, W void EffectsHandlerImpl::buildQuads(EffectWindow* w, WindowQuadList& quadList) { + static bool initIterator = true; + if (initIterator) { + m_currentBuildQuadsIterator = m_activeEffects.begin(); + initIterator = false; + } if (m_currentBuildQuadsIterator != m_activeEffects.end()) { (*m_currentBuildQuadsIterator++)->buildQuads(w, quadList); --m_currentBuildQuadsIterator; } + if (m_currentBuildQuadsIterator == m_activeEffects.begin()) + initIterator = true; } bool EffectsHandlerImpl::hasDecorationShadows() const @@ -341,7 +348,6 @@ void EffectsHandlerImpl::startPaint() m_currentPaintWindowIterator = m_activeEffects.begin(); m_currentPaintScreenIterator = m_activeEffects.begin(); m_currentPaintEffectFrameIterator = m_activeEffects.begin(); - m_currentBuildQuadsIterator = m_activeEffects.begin(); } void EffectsHandlerImpl::slotClientMaximized(KWin::Client *c, KDecorationDefines::MaximizeMode maxMode)