|
|
@ -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 <awilliam@redhat.com>
|
|
|
|
From: Adam Williamson <awilliam@redhat.com>
|
|
|
|
Date: Fri, 1 Sep 2023 17:09:16 -0700
|
|
|
|
Date: Fri, 1 Sep 2023 17:09:16 -0700
|
|
|
|
Subject: [PATCH] profiledefaults: don't automatically suspend by default if
|
|
|
|
Subject: [PATCH] profiledefaults: don't automatically suspend by default if
|
|
|
@ -13,10 +13,10 @@ Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
|
|
|
daemon/powerdevilcore.cpp | 4 +++-
|
|
|
|
daemon/powerdevilcore.cpp | 4 +++-
|
|
|
|
daemon/powerdevilpowermanagement.cpp | 17 +++++++++++++++++
|
|
|
|
daemon/powerdevilpowermanagement.cpp | 17 +++++++++++++++++
|
|
|
|
daemon/powerdevilpowermanagement.h | 1 +
|
|
|
|
daemon/powerdevilpowermanagement.h | 1 +
|
|
|
|
daemon/powerdevilprofilegenerator.cpp | 10 +++++-----
|
|
|
|
daemon/powerdevilprofilegenerator.cpp | 15 +++++++++------
|
|
|
|
daemon/powerdevilprofilegenerator.h | 2 +-
|
|
|
|
daemon/powerdevilprofilegenerator.h | 2 +-
|
|
|
|
kcmodule/profiles/EditPage.cpp | 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
|
|
|
|
diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp
|
|
|
|
index 0791552c..5c4f8a7d 100644
|
|
|
|
index 0791552c..5c4f8a7d 100644
|
|
|
@ -89,7 +89,7 @@ index 84c99f19..14069708 100644
|
|
|
|
bool canHibernate() const;
|
|
|
|
bool canHibernate() const;
|
|
|
|
bool canHybridSuspend() const;
|
|
|
|
bool canHybridSuspend() const;
|
|
|
|
diff --git a/daemon/powerdevilprofilegenerator.cpp b/daemon/powerdevilprofilegenerator.cpp
|
|
|
|
diff --git a/daemon/powerdevilprofilegenerator.cpp b/daemon/powerdevilprofilegenerator.cpp
|
|
|
|
index b3029e02..b70aa0d0 100644
|
|
|
|
index b3029e02..f6a5f3eb 100644
|
|
|
|
--- a/daemon/powerdevilprofilegenerator.cpp
|
|
|
|
--- a/daemon/powerdevilprofilegenerator.cpp
|
|
|
|
+++ b/daemon/powerdevilprofilegenerator.cpp
|
|
|
|
+++ b/daemon/powerdevilprofilegenerator.cpp
|
|
|
|
@@ -29,7 +29,7 @@
|
|
|
|
@@ -29,7 +29,7 @@
|
|
|
@ -101,7 +101,19 @@ index b3029e02..b70aa0d0 100644
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Change critical action if default (hibernate) is unavailable
|
|
|
|
// Change critical action if default (hibernate) is unavailable
|
|
|
|
if (!toDisk) {
|
|
|
|
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
|
|
|
|
// 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
|
|
|
|
// on mobile, 7 minutes, on laptop 15 minutes
|
|
|
|
auto timeout = mobile ? 420000 : 900000;
|
|
|
|
auto timeout = mobile ? 420000 : 900000;
|
|
|
|
KConfigGroup suspendSession(&acProfile, "SuspendSession");
|
|
|
|
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
|
|
|
|
// 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
|
|
|
|
// on mobile, 5 minute, on laptop 10 minutes
|
|
|
|
auto timeout = mobile ? 300000 : 600000;
|
|
|
|
auto timeout = mobile ? 300000 : 600000;
|
|
|
|
KConfigGroup suspendSession(&batteryProfile, "SuspendSession");
|
|
|
|
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
|
|
|
|
// 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
|
|
|
|
// on mobile by default never suspend, if device wants to suspend, it will enable
|
|
|
|
// using configuration overlay
|
|
|
|
// using configuration overlay
|
|
|
|