From f6d14f1b44024af910718c6d5b4e29939914e871 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 25 Oct 2022 16:55:23 +0200 Subject: [PATCH] effects/kscreen: don't stop effect when fade out animation is done The screen needs to stay black until it gets enabled again, otherwise slight timing differences can cause the screen to turn on full brightness again immediately before turning off. BUG: 460902 --- src/backends/drm/drm_output.cpp | 4 ++-- src/effects/kscreen/kscreen.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index 5cabeb64f3..c2971bdf6f 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -241,10 +241,10 @@ void DrmOutput::setDpmsMode(DpmsMode mode) } } else { m_gpu->platform()->checkOutputsAreOn(); - m_turnOffTimer.stop(); - if (mode != dpmsMode() && setDrmDpmsMode(mode)) { + if (m_turnOffTimer.isActive() || (mode != dpmsMode() && setDrmDpmsMode(mode))) { Q_EMIT wakeUp(); } + m_turnOffTimer.stop(); } } diff --git a/src/effects/kscreen/kscreen.cpp b/src/effects/kscreen/kscreen.cpp index 46ff266132..d9fa845323 100644 --- a/src/effects/kscreen/kscreen.cpp +++ b/src/effects/kscreen/kscreen.cpp @@ -102,7 +102,9 @@ void KscreenEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::millis state.m_timeLine.advance(presentTime); if (state.m_timeLine.done()) { switchState(state); - m_waylandStates.remove(data.screen); + if (state.m_state == StateNormal) { + m_waylandStates.remove(data.screen); + } } } }