From 833d4a63440c1e1f05dfabd0dc89764b3783696e Mon Sep 17 00:00:00 2001 From: msizanoen1 Date: Mon, 7 Mar 2022 12:35:20 +0700 Subject: local-display-factory: Ensure greeter sessions on non-primary seats are respawned on termination Trigger ensuring a greeter session for a non-primary seat when it terminates and only looking for displays with state of GDM_DISPLAY_MANAGED when checking for duplicates in ensure_display_for_seat on non-primary seats. --- daemon/gdm-local-display-factory.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c index 1b1d2e32..bf4782d1 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c @@ -549,7 +549,8 @@ 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 || factory->active_vt == GDM_INITIAL_VT || + g_strcmp0 (seat_id, "seat0") != 0)) { /* reset num failures */ factory->num_failures = 0; @@ -631,6 +632,21 @@ lookup_prepared_display_by_seat_id (const char *id, return lookup_by_seat_id (id, display, user_data); } +static gboolean +lookup_managed_display_by_seat_id (const char *id, + GdmDisplay *display, + gpointer user_data) +{ + int status; + + status = gdm_display_get_status (display); + + if (status != GDM_DISPLAY_MANAGED) + return FALSE; + + return lookup_by_seat_id (id, display, user_data); +} + #ifdef HAVE_UDEV static gboolean udev_is_settled (GdmLocalDisplayFactory *factory) @@ -745,7 +761,7 @@ get_display_for_seat (GdmLocalDisplayFactory *factory, if (is_seat0) display = gdm_display_store_find (store, lookup_prepared_display_by_seat_id, (gpointer) seat_id); else - display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id); + display = gdm_display_store_find (store, lookup_managed_display_by_seat_id, (gpointer) seat_id); return display; } -- cgit v1.2.1