Blame SOURCES/0001-power-Avoid-automatic-logout-in-GDM-greeter.patch

6c047f
From 77b52a04c9154a7e7b2434f6c70ba6b4fd84c9f1 Mon Sep 17 00:00:00 2001
6c047f
From: Benjamin Berg <bberg@redhat.com>
6c047f
Date: Thu, 15 Oct 2020 15:18:35 +0200
6c047f
Subject: [PATCH] power: Avoid automatic logout in GDM/greeter
6c047f
6c047f
In GDM sessions (greeter, initial-setup), it does not make sense to
6c047f
automatically logout. This can happen if the system wide default is
6c047f
changed to default to the "logout" action.
6c047f
6c047f
Note that we already use the RUNNING_UNDER_GDM environment variable in
6c047f
the keyboard plugin currently. So doing this is likely sane, even if we
6c047f
probably want a more elegant strategy to detect whether we are in a
6c047f
"login" session.
6c047f
---
6c047f
 plugins/power/gsd-power-manager.c | 3 +++
6c047f
 1 file changed, 3 insertions(+)
6c047f
6c047f
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
6c047f
index e103a8a7..b100ff9e 100644
6c047f
--- a/plugins/power/gsd-power-manager.c
6c047f
+++ b/plugins/power/gsd-power-manager.c
6c047f
@@ -872,6 +872,9 @@ static void
6c047f
 gnome_session_logout (GsdPowerManager *manager,
6c047f
                       guint            logout_mode)
6c047f
 {
6c047f
+        if (g_getenv("RUNNING_UNDER_GDM"))
6c047f
+                return;
6c047f
+
6c047f
         g_dbus_proxy_call (G_DBUS_PROXY (manager->priv->session),
6c047f
                            "Logout",
6c047f
                            g_variant_new ("(u)", logout_mode),
6c047f
-- 
6c047f
2.26.2
6c047f