Commit 41769214 authored by Ray Strode's avatar Ray Strode

local-display-factory: Remove same VT so don't switch check

We avoid changing to the login screen vt if we're already on it,
but the call is racy since we react to vt changes concurrently
with logind (who we query for the active vt).

This check drops the active vt check since it's pointless and
getting in the way.
parent c71bc5d6
...@@ -432,8 +432,7 @@ create_display (GdmLocalDisplayFactory *factory, ...@@ -432,8 +432,7 @@ create_display (GdmLocalDisplayFactory *factory,
{ {
GdmDisplayStore *store; GdmDisplayStore *store;
GdmDisplay *display = NULL; GdmDisplay *display = NULL;
char *active_session_id = NULL; g_autofree char *login_session_id = NULL;
int ret;
g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested", g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested",
session_type? : "X11", seat_id); session_type? : "X11", seat_id);
...@@ -450,31 +449,19 @@ create_display (GdmLocalDisplayFactory *factory, ...@@ -450,31 +449,19 @@ create_display (GdmLocalDisplayFactory *factory,
return NULL; return NULL;
} }
ret = sd_seat_get_active (seat_id, &active_session_id, NULL); /* If we already have a login window, switch to it */
if (gdm_get_login_window_session_id (seat_id, &login_session_id)) {
if (ret == 0) { GdmDisplay *display;
char *login_session_id = NULL;
display = gdm_display_store_find (store,
/* If we already have a login window, switch to it */ lookup_by_session_id,
if (gdm_get_login_window_session_id (seat_id, &login_session_id)) { (gpointer) login_session_id);
GdmDisplay *display; if (display != NULL && gdm_display_get_status (display) == GDM_DISPLAY_MANAGED) {
g_debug ("GdmLocalDisplayFactory: session %s found, activating.",
display = gdm_display_store_find (store, login_session_id);
lookup_by_session_id, gdm_activate_session_by_id (factory->priv->connection, seat_id, login_session_id);
(gpointer) login_session_id); return NULL;
if (display != NULL && gdm_display_get_status (display) == GDM_DISPLAY_MANAGED) {
if (g_strcmp0 (active_session_id, login_session_id) != 0) {
g_debug ("GdmLocalDisplayFactory: session %s found, activating.",
login_session_id);
gdm_activate_session_by_id (factory->priv->connection, 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);
} }
g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id); g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment