[plasma/plasma5support/Plasma/6.7] src/dataengines/powermanagement: Fix screen power management inhibition never being re-acquirable
Nate Graham <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 4039eed5cd578cc8da696961f25bbf361bea0eab by Nate Graham. Committed on 29/07/2026 at 17:27. Pushed by ngraham into branch 'Plasma/6.7'. Fix screen power management inhibition never being re-acquirable stopSuppressingScreenPowerManagement calls org.freedesktop.ScreenSaver.UnInhibit, which returns void, but declared the reply as QDBusReply<uint>. A void reply carries no arguments, so Qt's qDBusReplyFill falls through its type check and sets QDBusError::InvalidSignature, making isValid() always false. The cookie reset introduced in bea735c5 is conditional on isValid(), so m_lockInhibitionCookie is never cleared. Since that cookie is inline static and therefore process-wide, every subsequent beginSuppressingScreenPowerManagement hits its guard, returns success, and never contacts PowerDevil. Screen power management can only be inhibited once per process. Use QDBusReply<void>, matching stopSuppressingSleep in the same function. BUG: 523605 (cherry picked from commit 5d9f76c0acad446537b849693864e976eaf09a18) Co-authored-by: Vincent de Robert <[email protected]> M +1 -1 src/dataengines/powermanagement/powermanagementjob.cpp https://invent.kde.org/plasma/plasma5support/-/commit/4039eed5cd578cc8da696961f25bbf361bea0eab diff --git a/src/dataengines/powermanagement/powermanagementjob.cpp b/src/dataengines/powermanagement/powermanagementjob.cpp index 795b1bd..b4a7dbb 100644 --- a/src/dataengines/powermanagement/powermanagementjob.cpp +++ b/src/dataengines/powermanagement/powermanagementjob.cpp @@ -93,7 +93,7 @@ void PowerManagementJob::start() QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("UnInhibit")); msg << m_lockInhibitionCookie; - QDBusReply<uint> reply = QDBusConnection::sessionBus().call(msg); + QDBusReply<void> reply = QDBusConnection::sessionBus().call(msg); m_lockInhibitionCookie = reply.isValid() ? -1 : m_lockInhibitionCookie; // reset cookie if the stop request was successful setResult(reply.isValid()); return;