summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsizanoen1 <msizanoen@qtmlabs.xyz>2022-03-07 12:35:20 +0700
committerRay Strode <halfline@gmail.com>2023-05-08 13:50:11 +0000
commit833d4a63440c1e1f05dfabd0dc89764b3783696e (patch)
tree596252c23e301b52b95c51bafc441b08c36ffd60
parentc9ab58ba8650881571716efe1e0e0cd2c6da2fe7 (diff)
downloadgdm-833d4a63440c1e1f05dfabd0dc89764b3783696e.tar.gz
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.
-rw-r--r--daemon/gdm-local-display-factory.c20
1 files 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;
}