summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-10-04 14:01:44 -0400
committerRay Strode <rstrode@redhat.com>2021-04-12 16:57:53 -0400
commit592428ed768af081a7309346ae1feb04fbde8ef7 (patch)
treea3978213ff972abe56d4ca8bb817a8114c2a1784
parent8198d45776d84a8efe42d05616afa8c7569552b9 (diff)
downloadgdm-592428ed768af081a7309346ae1feb04fbde8ef7.tar.gz
local-display-factory: try even harder to get to a login screen
At the moment we sometimes fail to create a login screen when logout results in the user ending up on an empty VT. That is because we're accidentally running into the non-seat0 code path for seat0. This commit addresses the problem by specifically checking for if the seat is multi-session capable rather than checking if the seat has an active session.
-rw-r--r--daemon/gdm-local-display-factory.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 8b0b2e5c..cf4f5095 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -486,26 +486,29 @@ create_display (GdmLocalDisplayFactory *factory,
{
GdmDisplayStore *store;
GdmDisplay *display = NULL;
- char *active_session_id = NULL;
int ret;
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
- ret = sd_seat_get_active (seat_id, &active_session_id, NULL);
-
- if (ret == 0) {
+ if (sd_seat_can_multi_session (seat_id)) {
char *login_session_id = NULL;
/* If we already have a login window, switch to it */
if (get_login_window_session_id (seat_id, &login_session_id)) {
- if (g_strcmp0 (active_session_id, login_session_id) != 0) {
+ char *active_session_id = NULL;
+
+ ret = sd_seat_get_active (seat_id, &active_session_id, NULL);
+
+ if (ret == 0 && g_strcmp0 (active_session_id, login_session_id) != 0) {
activate_session_id (factory, seat_id, login_session_id);
+
+ g_clear_pointer (&login_session_id, g_free);
+ g_clear_pointer (&active_session_id, g_free);
+ return NULL;
}
+
g_clear_pointer (&login_session_id, g_free);
- g_clear_pointer (&active_session_id, g_free);
- return NULL;
}
- g_clear_pointer (&active_session_id, g_free);
} else {
/* Ensure we don't create the same display more than once */
display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id);