okular: reset screen and sleep cookies

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-22 13:51:23 +02:00
parent bf8de7389f
commit 1332e8a218

View file

@ -1546,11 +1546,15 @@ void PresentationWidget::allowPowerManagement()
{
// Remove cookies
if (m_screenInhibitCookie) {
Solid::PowerManagement::stopSuppressingScreenPowerManagement(m_screenInhibitCookie);
if (Solid::PowerManagement::stopSuppressingScreenPowerManagement(m_screenInhibitCookie)) {
m_screenInhibitCookie = 0;
}
}
if (m_sleepInhibitCookie) {
Solid::PowerManagement::stopSuppressingSleep(m_sleepInhibitCookie);
if (Solid::PowerManagement::stopSuppressingSleep(m_sleepInhibitCookie)) {
m_sleepInhibitCookie = 0;
}
}
}