|
|
765e07 |
From 91eee14bcd2447d78ad00e3de9d4380e423cb897 Mon Sep 17 00:00:00 2001
|
|
|
765e07 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
765e07 |
Date: Mon, 24 Sep 2018 10:53:53 -0400
|
|
|
4f3de9 |
Subject: [PATCH 6/7] daemon: ensure is-initial bit is transferred to new login
|
|
|
765e07 |
screen at logout
|
|
|
765e07 |
|
|
|
765e07 |
At the moment, when a user logs out we call sync_seats to restart the
|
|
|
765e07 |
login screen. sync_seats doesn't know whether or not vt1 is occupied.
|
|
|
765e07 |
|
|
|
765e07 |
This commit changes the code to call the more targeted `create_display`
|
|
|
765e07 |
function, which we can inform of vt1's availability by the is_initial
|
|
|
765e07 |
flag.
|
|
|
765e07 |
---
|
|
|
765e07 |
daemon/gdm-local-display-factory.c | 8 +++-----
|
|
|
765e07 |
1 file changed, 3 insertions(+), 5 deletions(-)
|
|
|
765e07 |
|
|
|
765e07 |
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
|
|
765e07 |
index cf852b55a..9a07f03ed 100644
|
|
|
765e07 |
--- a/daemon/gdm-local-display-factory.c
|
|
|
765e07 |
+++ b/daemon/gdm-local-display-factory.c
|
|
|
765e07 |
@@ -257,70 +257,68 @@ on_display_status_changed (GdmDisplay *display,
|
|
|
765e07 |
char *session_type = NULL;
|
|
|
765e07 |
char *session_class = NULL;
|
|
|
765e07 |
gboolean is_initial = TRUE;
|
|
|
765e07 |
gboolean is_local = TRUE;
|
|
|
765e07 |
|
|
|
765e07 |
num = -1;
|
|
|
765e07 |
gdm_display_get_x11_display_number (display, &num, NULL);
|
|
|
765e07 |
|
|
|
765e07 |
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
|
|
765e07 |
|
|
|
765e07 |
g_object_get (display,
|
|
|
765e07 |
"seat-id", &seat_id,
|
|
|
765e07 |
"is-initial", &is_initial,
|
|
|
765e07 |
"is-local", &is_local,
|
|
|
765e07 |
"session-type", &session_type,
|
|
|
765e07 |
"session-class", &session_class,
|
|
|
765e07 |
NULL);
|
|
|
765e07 |
|
|
|
765e07 |
status = gdm_display_get_status (display);
|
|
|
765e07 |
|
|
|
765e07 |
g_debug ("GdmLocalDisplayFactory: display status changed: %d", status);
|
|
|
765e07 |
switch (status) {
|
|
|
765e07 |
case GDM_DISPLAY_FINISHED:
|
|
|
765e07 |
/* remove the display number from factory->priv->used_display_numbers
|
|
|
765e07 |
so that it may be reused */
|
|
|
765e07 |
if (num != -1) {
|
|
|
765e07 |
g_hash_table_remove (factory->priv->used_display_numbers, GUINT_TO_POINTER (num));
|
|
|
765e07 |
}
|
|
|
765e07 |
gdm_display_store_remove (store, display);
|
|
|
765e07 |
|
|
|
765e07 |
- /* if this is a local display, do a full resync. Only
|
|
|
765e07 |
- * seats without displays will get created anyway. This
|
|
|
765e07 |
- * ensures we get a new login screen when the user logs out,
|
|
|
765e07 |
- * if there isn't one.
|
|
|
765e07 |
+ /* if this is a local display, recreate the display so
|
|
|
765e07 |
+ * a new login screen comes up if one is missing.
|
|
|
765e07 |
*/
|
|
|
765e07 |
if (is_local && g_strcmp0 (session_class, "greeter") != 0) {
|
|
|
765e07 |
/* reset num failures */
|
|
|
765e07 |
factory->priv->num_failures = 0;
|
|
|
765e07 |
|
|
|
765e07 |
- gdm_local_display_factory_sync_seats (factory);
|
|
|
765e07 |
+ create_display (factory, seat_id, session_type, is_initial);
|
|
|
765e07 |
}
|
|
|
765e07 |
break;
|
|
|
765e07 |
case GDM_DISPLAY_FAILED:
|
|
|
765e07 |
/* leave the display number in factory->priv->used_display_numbers
|
|
|
765e07 |
so that it doesn't get reused */
|
|
|
765e07 |
gdm_display_store_remove (store, display);
|
|
|
765e07 |
|
|
|
765e07 |
/* Create a new equivalent display if it was static */
|
|
|
765e07 |
if (is_local) {
|
|
|
765e07 |
|
|
|
765e07 |
factory->priv->num_failures++;
|
|
|
765e07 |
|
|
|
765e07 |
if (factory->priv->num_failures > MAX_DISPLAY_FAILURES) {
|
|
|
765e07 |
/* oh shit */
|
|
|
765e07 |
g_warning ("GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors");
|
|
|
765e07 |
} else {
|
|
|
765e07 |
#ifdef ENABLE_WAYLAND_SUPPORT
|
|
|
765e07 |
if (g_strcmp0 (session_type, "wayland") == 0) {
|
|
|
765e07 |
g_free (session_type);
|
|
|
765e07 |
session_type = NULL;
|
|
|
765e07 |
}
|
|
|
765e07 |
|
|
|
765e07 |
#endif
|
|
|
765e07 |
create_display (factory, seat_id, session_type, is_initial);
|
|
|
765e07 |
}
|
|
|
765e07 |
}
|
|
|
765e07 |
break;
|
|
|
765e07 |
case GDM_DISPLAY_UNMANAGED:
|
|
|
765e07 |
break;
|
|
|
765e07 |
case GDM_DISPLAY_PREPARED:
|
|
|
765e07 |
--
|
|
|
765e07 |
2.19.0
|
|
|
765e07 |
|