summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsizanoen1 <msizanoen@qtmlabs.xyz>2022-04-30 10:08:16 +0700
committerRay Strode <halfline@gmail.com>2023-05-08 13:50:11 +0000
commitea2b25c883055f95f027519a2e9f7c46f474fb43 (patch)
treed5352a280cd865a47a906f06ecf6874fe1b9fa49
parent833d4a63440c1e1f05dfabd0dc89764b3783696e (diff)
downloadgdm-ea2b25c883055f95f027519a2e9f7c46f474fb43.tar.gz
local-display-factory: Do not ensure login screen when a background user session terminates
-rw-r--r--daemon/gdm-local-display-factory.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index bf4782d1..e8fb4779 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -513,8 +513,10 @@ on_display_status_changed (GdmDisplay *display,
int status;
int num;
char *seat_id = NULL;
+ char *seat_active_session = NULL;
char *session_type = NULL;
char *session_class = NULL;
+ char *session_id = NULL;
gboolean is_initial = TRUE;
gboolean is_local = TRUE;
@@ -531,8 +533,11 @@ on_display_status_changed (GdmDisplay *display,
"is-local", &is_local,
"session-type", &session_type,
"session-class", &session_class,
+ "session-id", &session_id,
NULL);
+ sd_seat_get_active (seat_id, &seat_active_session, NULL);
+
status = gdm_display_get_status (display);
g_debug ("GdmLocalDisplayFactory: display status changed: %d", status);
@@ -549,7 +554,9 @@ on_display_status_changed (GdmDisplay *display,
* screen when the user logs out.
*/
if (is_local &&
- (g_strcmp0 (session_class, "greeter") != 0 || factory->active_vt == GDM_INITIAL_VT ||
+ ((g_strcmp0 (session_class, "greeter") != 0 &&
+ (!seat_active_session || g_strcmp0(session_id, seat_active_session) == 0)) ||
+ factory->active_vt == GDM_INITIAL_VT ||
g_strcmp0 (seat_id, "seat0") != 0)) {
/* reset num failures */
factory->num_failures = 0;
@@ -595,8 +602,10 @@ on_display_status_changed (GdmDisplay *display,
}
g_free (seat_id);
+ g_free (seat_active_session);
g_free (session_type);
g_free (session_class);
+ g_free (session_id);
}
static gboolean