mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
generic: implement hybrid suspend/sleep method
marking as extension because it was not implemented before and the FDO spec is dead (i.e. not a spec anymore), may or may not work with other power managers implementing the interface (org.freedesktop.PowerManagement) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c06770a96f
commit
bdccbb1709
4 changed files with 17 additions and 0 deletions
|
@ -146,6 +146,17 @@ void KPowerManagerImpl::Hibernate()
|
|||
}
|
||||
}
|
||||
|
||||
void KPowerManagerImpl::HybridSuspend()
|
||||
{
|
||||
if (m_login1.isValid()) {
|
||||
m_login1.asyncCall("HybridSleep", true);
|
||||
return;
|
||||
}
|
||||
if (m_consolekit.isValid()) {
|
||||
m_consolekit.asyncCall("HybridSleep", true);
|
||||
}
|
||||
}
|
||||
|
||||
void KPowerManagerImpl::Suspend()
|
||||
{
|
||||
if (m_login1.isValid()) {
|
||||
|
|
|
@ -38,6 +38,7 @@ public Q_SLOTS:
|
|||
bool CanSuspend();
|
||||
bool GetPowerSaveStatus();
|
||||
void Hibernate();
|
||||
void HybridSuspend(); // extension
|
||||
void Suspend();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
<method name="Suspend"/>
|
||||
<method name="Hibernate"/>
|
||||
<method name="HybridSuspend"/>
|
||||
<method name="CanSuspend">
|
||||
<arg type="b" name="can_suspend" direction="out"/>
|
||||
</method>
|
||||
|
|
|
@ -110,6 +110,10 @@ void Solid::PowerManagement::requestSleep(SleepState state, QObject *receiver, c
|
|||
globalPowerManager()->managerIface->asyncCall("Hibernate");
|
||||
break;
|
||||
}
|
||||
case HybridSuspendState: {
|
||||
globalPowerManager()->managerIface->asyncCall("HybridSuspend");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue