• R/O
  • HTTP
  • SSH
  • HTTPS

kdelibs: Commit

Katana libraries


Commit MetaInfo

Revisionbdccbb17099e41922fcc3ff32a43e6d9db684cdf (tree)
Time2022-11-30 09:14:44
AuthorIvailo Monev <xakepa10@gmai...>
CommiterIvailo Monev

Log Message

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>

Change Summary

Incremental Difference

--- a/kutils/kpowermanager/kded/kpowermanagerimpl.cpp
+++ b/kutils/kpowermanager/kded/kpowermanagerimpl.cpp
@@ -146,6 +146,17 @@ void KPowerManagerImpl::Hibernate()
146146 }
147147 }
148148
149+void KPowerManagerImpl::HybridSuspend()
150+{
151+ if (m_login1.isValid()) {
152+ m_login1.asyncCall("HybridSleep", true);
153+ return;
154+ }
155+ if (m_consolekit.isValid()) {
156+ m_consolekit.asyncCall("HybridSleep", true);
157+ }
158+}
159+
149160 void KPowerManagerImpl::Suspend()
150161 {
151162 if (m_login1.isValid()) {
--- a/kutils/kpowermanager/kded/kpowermanagerimpl.h
+++ b/kutils/kpowermanager/kded/kpowermanagerimpl.h
@@ -38,6 +38,7 @@ public Q_SLOTS:
3838 bool CanSuspend();
3939 bool GetPowerSaveStatus();
4040 void Hibernate();
41+ void HybridSuspend(); // extension
4142 void Suspend();
4243
4344 Q_SIGNALS:
--- a/kutils/kpowermanager/kded/org.freedesktop.PowerManagement.xml
+++ b/kutils/kpowermanager/kded/org.freedesktop.PowerManagement.xml
@@ -19,6 +19,7 @@
1919
2020 <method name="Suspend"/>
2121 <method name="Hibernate"/>
22+ <method name="HybridSuspend"/>
2223 <method name="CanSuspend">
2324 <arg type="b" name="can_suspend" direction="out"/>
2425 </method>
--- a/solid/solid/powermanagement.cpp
+++ b/solid/solid/powermanagement.cpp
@@ -110,6 +110,10 @@ void Solid::PowerManagement::requestSleep(SleepState state, QObject *receiver, c
110110 globalPowerManager()->managerIface->asyncCall("Hibernate");
111111 break;
112112 }
113+ case HybridSuspendState: {
114+ globalPowerManager()->managerIface->asyncCall("HybridSuspend");
115+ break;
116+ }
113117 }
114118 }
115119
Show on old repository browser