mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: fix screen power management supressesion
this has been broken since before the fork because message was send with wrong cookie type Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
806b06db55
commit
58f6472d45
1 changed files with 7 additions and 2 deletions
|
@ -136,6 +136,7 @@ bool Solid::PowerManagement::stopSuppressingSleep(int cookie)
|
|||
|
||||
int Solid::PowerManagement::beginSuppressingScreenPowerManagement(const QString& reason)
|
||||
{
|
||||
#warning TODO: the return type should be uint
|
||||
if (globalPowerManager()->saverIface.isValid()) {
|
||||
QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.ScreenSaver"),
|
||||
QLatin1String("/ScreenSaver"),
|
||||
|
@ -157,14 +158,18 @@ int Solid::PowerManagement::beginSuppressingScreenPowerManagement(const QString&
|
|||
|
||||
bool Solid::PowerManagement::stopSuppressingScreenPowerManagement(int cookie)
|
||||
{
|
||||
#warning TODO: the cookie type should be uint
|
||||
if (globalPowerManager()->saverIface.isValid()) {
|
||||
if (globalPowerManager()->screensaverCookies.contains(cookie)) {
|
||||
QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.ScreenSaver"),
|
||||
QLatin1String("/ScreenSaver"),
|
||||
QLatin1String("org.freedesktop.ScreenSaver"),
|
||||
QLatin1String("UnInhibit"));
|
||||
message << cookie;
|
||||
QDBusConnection::sessionBus().asyncCall(message);
|
||||
message << uint(cookie);
|
||||
QDBusReply<void> ssReply = QDBusConnection::sessionBus().call(message);
|
||||
if (ssReply.isValid()) {
|
||||
globalPowerManager()->screensaverCookies.removeAll(cookie);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue