Backport MR #325 to avoid auto-suspend on VMs (#2180047)

This commit is contained in:
Adam Williamson 2023-03-22 16:11:16 -07:00
parent 468540c0cb
commit 6ad134fd08
2 changed files with 44 additions and 0 deletions

39
325.patch Normal file
View File

@ -0,0 +1,39 @@
From ab5004079080bc9bdfb17bd6e8c43d0d702716dd Mon Sep 17 00:00:00 2001
From: Felipe Borges <felipeborges@gnome.org>
Date: Tue, 21 Mar 2023 11:46:44 +0100
Subject: [PATCH] power: Initialize check for VM environment earlier
Otherwise it will be called uninitialized when auto suspending.
Fixes #736
---
plugins/power/gsd-power-manager.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 0263e9f6..2b27af0b 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2871,9 +2871,6 @@ on_rr_screen_acquired (GObject *object,
if (!gnome_settings_is_wayland ())
manager->xscreensaver_watchdog_timer_id = gsd_power_enable_screensaver_watchdog ();
- /* don't blank inside a VM */
- manager->is_virtual_machine = gsd_power_is_hardware_a_vm ();
-
/* queue a signal in case the proxy from gnome-shell was created before we got here
(likely, considering that to get here we need a reply from gnome-shell)
*/
@@ -3003,6 +3000,9 @@ gsd_power_manager_start (GsdPowerManager *manager,
g_debug ("Starting power manager");
gnome_settings_profile_start (NULL);
+ /* Check whether we are running in a VM */
+ manager->is_virtual_machine = gsd_power_is_hardware_a_vm ();
+
/* Check whether we have a lid first */
manager->up_client = up_client_new ();
manager->lid_is_present = up_client_get_lid_is_present (manager->up_client);
--
GitLab

View File

@ -24,6 +24,11 @@ Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
License: GPL-2.0-or-later AND LGPL-2.1-or-later
URL: https://gitlab.gnome.org/GNOME/gnome-settings-daemon
Source0: https://download.gnome.org/sources/%{name}/%{major_version}/%{name}-%{tarball_version}.tar.xz
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/325
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/736
# https://bugzilla.redhat.com/show_bug.cgi?id=2180047
# Ensure auto-suspend does not apply to VMs
Patch0: 325.patch
BuildRequires: gcc
BuildRequires: gettext