diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -426,6 +426,7 @@ m_scene = NULL; compositeTimer.stop(); repaints_region = QRegion(); + m_bufferSwapPending = false; m_state = State::Off; emit compositingToggled(false); @@ -628,14 +629,15 @@ void Compositor::bufferSwapComplete() { - assert(m_bufferSwapPending); m_bufferSwapPending = false; emit bufferSwapCompleted(); if (m_composeAtSwapCompletion) { m_composeAtSwapCompletion = false; - performCompositing(); + // We start the composite timer here to avoid calling + // performCompositing() from the event handler. + compositeTimer.start(1, this); } }