diff --git a/0001-profiledefaults-don-t-automatically-suspend-by-defau.patch b/0001-profiledefaults-don-t-automatically-suspend-by-defau.patch index 07ac5f1..61450f9 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 795ac6b8b40cd882235adeed4c83356d1ca79f61 Mon Sep 17 00:00:00 2001 +From 5a523543de6bffc0f6d78eab1a6bf27c1454d752 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 @@ -11,12 +11,12 @@ from Natalie Clarius, rebased on 5.27.7. Signed-off-by: Adam Williamson --- daemon/powerdevilcore.cpp | 4 +++- - daemon/powerdevilpowermanagement.cpp | 17 +++++++++++++++++ + daemon/powerdevilpowermanagement.cpp | 21 +++++++++++++++++++++ daemon/powerdevilpowermanagement.h | 1 + daemon/powerdevilprofilegenerator.cpp | 17 ++++++++++------- daemon/powerdevilprofilegenerator.h | 2 +- kcmodule/profiles/EditPage.cpp | 2 ++ - 6 files changed, 34 insertions(+), 9 deletions(-) + 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp index 0791552c..5c4f8a7d 100644 @@ -42,7 +42,7 @@ index 0791552c..5c4f8a7d 100644 } diff --git a/daemon/powerdevilpowermanagement.cpp b/daemon/powerdevilpowermanagement.cpp -index 7b8e8d5d..ca4c9f07 100644 +index 7b8e8d5d..573a6a7d 100644 --- a/daemon/powerdevilpowermanagement.cpp +++ b/daemon/powerdevilpowermanagement.cpp @@ -19,6 +19,7 @@ License along with this library. If not, see . @@ -53,12 +53,16 @@ index 7b8e8d5d..ca4c9f07 100644 #include #include -@@ -217,6 +218,22 @@ void PowerManagement::suspendThenHibernate() +@@ -217,6 +218,26 @@ void PowerManagement::suspendThenHibernate() QDBusConnection::sessionBus().asyncCall(message); } +bool PowerManagement::isVirtualMachine() +{ ++ if (!QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.systemd1"))) { ++ // can't check, fall back to assuming false ++ return false; ++ } + QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"), + QStringLiteral("/org/freedesktop/systemd1"), + QStringLiteral("org.freedesktop.DBus.Properties"), diff --git a/powerdevil.spec b/powerdevil.spec index b42bb4e..7a81b13 100644 --- a/powerdevil.spec +++ b/powerdevil.spec @@ -2,7 +2,7 @@ Name: powerdevil Version: 5.27.7 -Release: 4%{?dist} +Release: 5%{?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 +* Mon Sep 04 2023 Adam Williamson - 5.27.7-5 +- Update patch again to check systemd interface is there + * Sun Sep 03 2023 Adam Williamson - 5.27.7-4 - Update patch again to also disable lid suspend on VMs (per Natalie)