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
This commit is contained in:
Thomas Lübking 2012-05-07 22:29:54 +02:00
parent f3443a6b07
commit 601243e549

View file

@ -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)