diff --git a/daemon/actions/bundled/dimdisplay.cpp b/daemon/actions/bundled/dimdisplay.cpp --- a/daemon/actions/bundled/dimdisplay.cpp +++ b/daemon/actions/bundled/dimdisplay.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -46,8 +47,10 @@ return; } // An active inhibition may not let us restore the brightness. - // Let's override it so that we don't leave the user with a dimmed screen. - setBrightnessHelper(m_oldScreenBrightness, m_oldKeyboardBrightness, true); + // We should wait a bit screen to wake-up from sleep + QTimer::singleShot(0, this, [this]() { + setBrightnessHelper(m_oldScreenBrightness, m_oldKeyboardBrightness, true); + }); m_dimmed = false; } diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp --- a/daemon/powerdevilcore.cpp +++ b/daemon/powerdevilcore.cpp @@ -341,7 +341,6 @@ if (m_pendingWakeupEvent) { // Fake activity at this stage, when no timeouts are registered onResumingFromIdle(); - KIdleTime::instance()->simulateUserActivity(); m_pendingWakeupEvent = false; } } else { @@ -352,7 +351,6 @@ if (m_pendingWakeupEvent) { // Fake activity at this stage, when no timeouts are registered onResumingFromIdle(); - KIdleTime::instance()->simulateUserActivity(); m_pendingWakeupEvent = false; } @@ -833,6 +831,7 @@ void Core::onResumingFromIdle() { + KIdleTime::instance()->simulateUserActivity(); // Wake up the actions in which an idle action was triggered std::for_each(m_pendingResumeFromIdleActions.cbegin(), m_pendingResumeFromIdleActions.cend(), std::mem_fn(&PowerDevil::Action::onWakeupFromIdle));