diff --git a/SOURCES/0001-power-Avoid-automatic-logout-in-GDM-greeter.patch b/SOURCES/0001-power-Avoid-automatic-logout-in-GDM-greeter.patch new file mode 100644 index 0000000..0df4e39 --- /dev/null +++ b/SOURCES/0001-power-Avoid-automatic-logout-in-GDM-greeter.patch @@ -0,0 +1,34 @@ +From 77b52a04c9154a7e7b2434f6c70ba6b4fd84c9f1 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Thu, 15 Oct 2020 15:18:35 +0200 +Subject: [PATCH] power: Avoid automatic logout in GDM/greeter + +In GDM sessions (greeter, initial-setup), it does not make sense to +automatically logout. This can happen if the system wide default is +changed to default to the "logout" action. + +Note that we already use the RUNNING_UNDER_GDM environment variable in +the keyboard plugin currently. So doing this is likely sane, even if we +probably want a more elegant strategy to detect whether we are in a +"login" session. +--- + plugins/power/gsd-power-manager.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index e103a8a7..b100ff9e 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -872,6 +872,9 @@ static void + gnome_session_logout (GsdPowerManager *manager, + guint logout_mode) + { ++ if (g_getenv("RUNNING_UNDER_GDM")) ++ return; ++ + g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session), + "Logout", + g_variant_new ("(u)", logout_mode), +-- +2.26.2 + diff --git a/SOURCES/0001-power-Only-disable-Suspend-Hibernate-actions-inside-.patch b/SOURCES/0001-power-Only-disable-Suspend-Hibernate-actions-inside-.patch new file mode 100644 index 0000000..87ccb75 --- /dev/null +++ b/SOURCES/0001-power-Only-disable-Suspend-Hibernate-actions-inside-.patch @@ -0,0 +1,53 @@ +From e1ccd6042815f7fa7c9a30fe8569cd612bdabc0d Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Tue, 7 May 2019 15:40:20 +0200 +Subject: [PATCH] power: Only disable Suspend/Hibernate actions inside VM + +While we theoretically only want a different default value inside a VM, +we currently hack this by never doing a suspend action inside VMs. +However, that also breaks automatic logout, which is an unintended side +effect. + +Move the check to not install the corresponding timeout (preventing +sleep warnings from being displayed) and also only enforce the VM +specific hack for the Suspend and Hibernate actions. +--- + plugins/power/gsd-power-manager.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index 82d81e96..e103a8a7 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -1550,13 +1550,6 @@ idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode) + return; + } + +- /* don't do any power saving if we're a VM */ +- if (manager->priv->is_virtual_machine) { +- g_debug ("ignoring state transition to %s as virtual machine", +- idle_mode_to_string (mode)); +- return; +- } +- + manager->priv->current_idle_mode = mode; + g_debug ("Doing a state transition: %s", idle_mode_to_string (mode)); + +@@ -1769,6 +1762,14 @@ idle_configure (GsdPowerManager *manager) + clear_idle_watch (manager->priv->idle_monitor, + &manager->priv->idle_sleep_warning_id); + ++ /* don't do any power saving if we're a VM */ ++ if (manager->priv->is_virtual_machine && ++ (action_type == GSD_POWER_ACTION_SUSPEND || ++ action_type == GSD_POWER_ACTION_HIBERNATE)) { ++ g_debug ("Ignoring sleep timeout with suspend action inside VM"); ++ timeout_sleep = 0; ++ } ++ + if (timeout_sleep != 0) { + g_debug ("setting up sleep callback %is", timeout_sleep); + +-- +2.26.2 + diff --git a/SOURCES/0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch b/SOURCES/0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch new file mode 100644 index 0000000..41dcac8 --- /dev/null +++ b/SOURCES/0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch @@ -0,0 +1,49 @@ +From f2cd5fb30892e3868732fca1d38fc15fdb73ec18 Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Tue, 27 Oct 2020 10:20:34 +0100 +Subject: [PATCH 2/2] power: Never register sleep timeout for logout in GDM + +We already suppress logout actions in GDM (10aa1714b05b, power: Avoid +automatic logout in GDM/greeter). However, while this prevents the +action, we may still warn. + +Change it so that the corresponding timeouts will never be registered. +Leave the guard in gnome_session_logout but add a warning as we should +never be hitting that code path. +--- + plugins/power/gsd-power-manager.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index 9f2e858e..ed855b6b 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -872,8 +872,10 @@ static void + gnome_session_logout (GsdPowerManager *manager, + guint logout_mode) + { +- if (g_getenv("RUNNING_UNDER_GDM")) ++ if (g_getenv ("RUNNING_UNDER_GDM")) { ++ g_warning ("Prevented logout from GDM session! This indicates an issue in gsd-power."); + return; ++ } + + g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session), + "Logout", +@@ -1773,6 +1775,13 @@ idle_configure (GsdPowerManager *manager) + timeout_sleep = 0; + } + ++ /* don't do any automatic logout if we are in GDM */ ++ if (g_getenv ("RUNNING_UNDER_GDM") && ++ (action_type == GSD_POWER_ACTION_LOGOUT)) { ++ g_debug ("Ignoring sleep timeout with logout action inside GDM"); ++ timeout_sleep = 0; ++ } ++ + if (timeout_sleep != 0) { + g_debug ("setting up sleep callback %is", timeout_sleep); + +-- +2.26.2 + diff --git a/SPECS/gnome-settings-daemon.spec b/SPECS/gnome-settings-daemon.spec index c03f280..34481ed 100644 --- a/SPECS/gnome-settings-daemon.spec +++ b/SPECS/gnome-settings-daemon.spec @@ -8,7 +8,7 @@ Name: gnome-settings-daemon Version: 3.28.1 -Release: 8%{?dist} +Release: 10%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications License: GPLv2+ @@ -40,6 +40,10 @@ Patch53: 0001-xsettings-don-t-complain-at-start-up-when-fetching-w.patch Patch54: 0001-common-Add-display-mapping-check-specific-for-the-De.patch +Patch60: 0001-power-Only-disable-Suspend-Hibernate-actions-inside-.patch +Patch61: 0001-power-Avoid-automatic-logout-in-GDM-greeter.patch +Patch62: 0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch + BuildRequires: cups-devel BuildRequires: gettext BuildRequires: meson @@ -240,6 +244,16 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_libexecdir}/gsd-test-input-helper %changelog +* Fri Oct 30 2020 Benjamin Berg - 3.28.1-10 +- Prevent automatic logout warning in greeter sessions + Related: #1729296 + +* Mon Oct 19 2020 Benjamin Berg - 3.28.1-9 +- Keep auto-logout working inside VMs + Resolves: #1672998 +- Never log out automatically from greeter sessions + Resolves: #1729296 + * Fri Sep 06 2019 Carlos Garnacho - 3.28.1-8 - Add display mapping check specific for the Dell Canvas Resolves: #1548320