diff --git a/0001-profiledefaults-don-t-automatically-suspend-by-defau.patch b/0001-profiledefaults-don-t-automatically-suspend-by-defau.patch index c09c0ac..fa8e6ae 100644 --- a/0001-profiledefaults-don-t-automatically-suspend-by-defau.patch +++ b/0001-profiledefaults-don-t-automatically-suspend-by-defau.patch @@ -1,4 +1,4 @@ -From ce233c616d8ec5141e24d4962739040b4c99d989 Mon Sep 17 00:00:00 2001 +From a1a3ae586cf1e10eec6930f088a5ad72631d22fd Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 1 Sep 2023 17:09:16 -0700 Subject: [PATCH] profiledefaults: don't automatically suspend by default if @@ -13,10 +13,10 @@ Signed-off-by: Adam Williamson daemon/powerdevilcore.cpp | 4 +++- daemon/powerdevilpowermanagement.cpp | 17 +++++++++++++++++ daemon/powerdevilpowermanagement.h | 1 + - daemon/powerdevilprofilegenerator.cpp | 10 +++++----- + daemon/powerdevilprofilegenerator.cpp | 15 +++++++++------ daemon/powerdevilprofilegenerator.h | 2 +- kcmodule/profiles/EditPage.cpp | 2 ++ - 6 files changed, 29 insertions(+), 7 deletions(-) + 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp index 0791552c..5c4f8a7d 100644 @@ -89,7 +89,7 @@ index 84c99f19..14069708 100644 bool canHibernate() const; bool canHybridSuspend() const; diff --git a/daemon/powerdevilprofilegenerator.cpp b/daemon/powerdevilprofilegenerator.cpp -index b3029e02..b70aa0d0 100644 +index b3029e02..f6a5f3eb 100644 --- a/daemon/powerdevilprofilegenerator.cpp +++ b/daemon/powerdevilprofilegenerator.cpp @@ -29,7 +29,7 @@ @@ -101,7 +101,19 @@ index b3029e02..b70aa0d0 100644 { // Change critical action if default (hibernate) is unavailable if (!toDisk) { -@@ -91,8 +91,8 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) +@@ -71,7 +71,10 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) + KConfigGroup handleButtonEvents(&profile, "HandleButtonEvents"); + handleButtonEvents.writeEntry< uint >("powerButtonAction", defaultPowerButtonAction); + handleButtonEvents.writeEntry< uint >("powerDownAction", LogoutDialogMode); +- if (toRam) { ++ if (vm) { ++ handleButtonEvents.writeEntry< uint >("lidAction", NoneMode); ++ } ++ else if (toRam) { + handleButtonEvents.writeEntry< uint >("lidAction", ToRamMode); + } else { + handleButtonEvents.writeEntry< uint >("lidAction", TurnOffScreenMode); +@@ -91,8 +94,8 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) } // Even on AC power, suspend after a rather long period of inactivity. Energy @@ -112,7 +124,7 @@ index b3029e02..b70aa0d0 100644 // on mobile, 7 minutes, on laptop 15 minutes auto timeout = mobile ? 420000 : 900000; KConfigGroup suspendSession(&acProfile, "SuspendSession"); -@@ -124,7 +124,7 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) +@@ -124,7 +127,7 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) } // Last but not least, we want to suspend after some inactivity @@ -121,7 +133,7 @@ index b3029e02..b70aa0d0 100644 // on mobile, 5 minute, on laptop 10 minutes auto timeout = mobile ? 300000 : 600000; KConfigGroup suspendSession(&batteryProfile, "SuspendSession"); -@@ -164,7 +164,7 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) +@@ -164,7 +167,7 @@ void ProfileGenerator::generateProfiles(bool mobile, bool toRam, bool toDisk) // Last but not least, we want to suspend after a rather long period of inactivity // on mobile by default never suspend, if device wants to suspend, it will enable // using configuration overlay diff --git a/powerdevil.spec b/powerdevil.spec index 15fd02e..b42bb4e 100644 --- a/powerdevil.spec +++ b/powerdevil.spec @@ -2,7 +2,7 @@ Name: powerdevil Version: 5.27.7 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Manages the power consumption settings of a Plasma Shell License: GPLv2+ @@ -140,6 +140,9 @@ rm -fv %{buildroot}/%{_libdir}/libpowerdevil{configcommonprivate,core,ui}.so %{_kf5_qtplugindir}/powerdevil/action/powerdevil_*.so %changelog +* Sun Sep 03 2023 Adam Williamson - 5.27.7-4 +- Update patch again to also disable lid suspend on VMs (per Natalie) + * Fri Sep 01 2023 Adam Williamson - 5.27.7-3 - Fix a bug in the backported patch (thanks Natalie, the original author)