diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index f7e33d78..98f31081 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -235,12 +235,17 @@ void KSMShutdownDlg::slotSuspend(int spdMethod) { switch (spdMethod) { case Solid::PowerManagement::StandbyState: + Solid::PowerManagement::requestSleep(Solid::PowerManagement::StandbyState, 0, 0); + break; case Solid::PowerManagement::SuspendState: Solid::PowerManagement::requestSleep(Solid::PowerManagement::SuspendState, 0, 0); break; case Solid::PowerManagement::HibernateState: Solid::PowerManagement::requestSleep(Solid::PowerManagement::HibernateState, 0, 0); break; + case Solid::PowerManagement::HybridSuspendState: + Solid::PowerManagement::requestSleep(Solid::PowerManagement::HybridSuspendState, 0, 0); + break; } reject(); } diff --git a/ksmserver/themes/contour/main.qml b/ksmserver/themes/contour/main.qml index 1c18f001..a2a06d8a 100644 --- a/ksmserver/themes/contour/main.qml +++ b/ksmserver/themes/contour/main.qml @@ -123,7 +123,11 @@ PlasmaCore.FrameSvgItem { onClicked: { //console.log("contour.qml: sleep requested") timer.running = false - if (spdMethods.SuspendState) { + if (spdMethods.HybridSuspendState) { + suspendRequested(8); // Solid::PowerManagement::HybridSuspendState + } else if (spdMethods.HibernateState) { + suspendRequested(4); // Solid::PowerManagement::HibernateState + } else if (spdMethods.SuspendState) { suspendRequested(2); // Solid::PowerManagement::SuspendState } else if (spdMethods.StandbyState) { suspendRequested(1); // Solid::PowerManagement::StandbyState diff --git a/ksmserver/themes/default/main.qml b/ksmserver/themes/default/main.qml index 55766bc5..d034765f 100644 --- a/ksmserver/themes/default/main.qml +++ b/ksmserver/themes/default/main.qml @@ -264,7 +264,7 @@ PlasmaCore.FrameSvgItem { iconSource: "system-shutdown" anchors.right: parent.right visible: (choose || sdtype == ShutdownType.ShutdownTypeHalt) - menu: spdMethods.StandbyState | spdMethods.SuspendState | spdMethods.HibernateState + menu: spdMethods.StandbyState | spdMethods.SuspendState | spdMethods.HibernateState | spdMethods.HybridSuspendState tabStopNext: rebootButton tabStopBack: logoutButton @@ -291,6 +291,10 @@ PlasmaCore.FrameSvgItem { // 4 == Solid::PowerManagement::HibernateState contextMenu.append({itemIndex: 4, itemText: i18n("Suspend to &Disk"), itemSubMenu: null, itemAllowAmpersand: false}) } + if (spdMethods.HybridSuspendState) { + // 8 == Solid::PowerManagement::HybridSuspendState + contextMenu.append({itemIndex: 8, itemText: i18n("&Hybrid Suspend"), itemSubMenu: null, itemAllowAmpersand: false}) + } contextMenu.clicked.connect(shutdownUi.suspendRequested) } contextMenu.open()