Blame SOURCES/0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch

cd454c
From f2cd5fb30892e3868732fca1d38fc15fdb73ec18 Mon Sep 17 00:00:00 2001
cd454c
From: Benjamin Berg <bberg@redhat.com>
cd454c
Date: Tue, 27 Oct 2020 10:20:34 +0100
cd454c
Subject: [PATCH 2/2] power: Never register sleep timeout for logout in GDM
cd454c
cd454c
We already suppress logout actions in GDM (10aa1714b05b, power: Avoid
cd454c
automatic logout in GDM/greeter). However, while this prevents the
cd454c
action, we may still warn.
cd454c
cd454c
Change it so that the corresponding timeouts will never be registered.
cd454c
Leave the guard in gnome_session_logout but add a warning as we should
cd454c
never be hitting that code path.
cd454c
---
cd454c
 plugins/power/gsd-power-manager.c | 11 ++++++++++-
cd454c
 1 file changed, 10 insertions(+), 1 deletion(-)
cd454c
cd454c
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
cd454c
index 9f2e858e..ed855b6b 100644
cd454c
--- a/plugins/power/gsd-power-manager.c
cd454c
+++ b/plugins/power/gsd-power-manager.c
cd454c
@@ -872,8 +872,10 @@ static void
cd454c
 gnome_session_logout (GsdPowerManager *manager,
cd454c
                       guint            logout_mode)
cd454c
 {
cd454c
-        if (g_getenv("RUNNING_UNDER_GDM"))
cd454c
+        if (g_getenv ("RUNNING_UNDER_GDM")) {
cd454c
+                g_warning ("Prevented logout from GDM session! This indicates an issue in gsd-power.");
cd454c
                 return;
cd454c
+        }
cd454c
 
cd454c
         g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
cd454c
                            "Logout",
cd454c
@@ -1773,6 +1775,13 @@ idle_configure (GsdPowerManager *manager)
cd454c
                 timeout_sleep = 0;
cd454c
         }
cd454c
 
cd454c
+        /* don't do any automatic logout if we are in GDM */
cd454c
+        if (g_getenv ("RUNNING_UNDER_GDM") &&
cd454c
+            (action_type == GSD_POWER_ACTION_LOGOUT)) {
cd454c
+                g_debug ("Ignoring sleep timeout with logout action inside GDM");
cd454c
+                timeout_sleep = 0;
cd454c
+        }
cd454c
+
cd454c
         if (timeout_sleep != 0) {
cd454c
                 g_debug ("setting up sleep callback %is", timeout_sleep);
cd454c
 
cd454c
-- 
cd454c
2.26.2
cd454c