[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:
parent
ffa075490e
commit
679da47235
1 changed files with 12 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue