[wayland] Don't run Compositor loop if all outputs are disabled

This ensures that the Compositor doesn't perform compositing and doesn't
run the compositing timer if e.g. all outputs are dpms disabled. Thus
we don't render any more, don't trigger wakeups and block applications
from rendering if they properly implement the frame rendered callback.
This commit is contained in:
Martin Gräßlin 2015-08-31 13:54:50 +02:00
parent ffa075490e
commit 679da47235

View file

@ -640,6 +640,13 @@ void Compositor::performCompositing()
return;
}
// If outputs are disabled, we return to the event loop and
// continue processing events until the outputs are enabled again
if (waylandServer() && !waylandServer()->backend()->areOutputsEnabled()) {
compositeTimer.stop();
return;
}
// Create a list of all windows in the stacking order
ToplevelList windows = Workspace::self()->xStackingOrder();
ToplevelList damaged;
@ -773,6 +780,11 @@ void Compositor::setCompositeTimer()
if (m_bufferSwapPending && m_composeAtSwapCompletion)
return;
// Don't start the timer if all outputs are disabled
if (waylandServer() && !waylandServer()->backend()->areOutputsEnabled()) {
return;
}
uint waitTime = 1;
if (m_scene->blocksForRetrace()) {