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