summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-09-25 14:30:16 -0400
committerRay Strode <rstrode@redhat.com>2018-09-25 14:52:43 -0400
commit4176921462866d80ea0ca8eceea9e1dfd06217ae (patch)
tree3c8e7e6ba7281fcbfb789275557716762ed8f847
parentc71bc5d6c3bc2ec448b5c72ce9a811d9c0c7905e (diff)
downloadgdm-4176921462866d80ea0ca8eceea9e1dfd06217ae.tar.gz
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.
-rw-r--r--daemon/gdm-local-display-factory.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index be4bac0a..244a3201 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -432,8 +432,7 @@ create_display (GdmLocalDisplayFactory *factory,
{
GdmDisplayStore *store;
GdmDisplay *display = NULL;
- char *active_session_id = NULL;
- int ret;
+ g_autofree char *login_session_id = NULL;
g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested",
session_type? : "X11", seat_id);
@@ -450,31 +449,19 @@ create_display (GdmLocalDisplayFactory *factory,
return NULL;
}
- ret = sd_seat_get_active (seat_id, &active_session_id, NULL);
-
- if (ret == 0) {
- char *login_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)) {
- GdmDisplay *display;
-
- display = gdm_display_store_find (store,
- lookup_by_session_id,
- (gpointer) login_session_id);
- 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);
+ /* If we already have a login window, switch to it */
+ if (gdm_get_login_window_session_id (seat_id, &login_session_id)) {
+ GdmDisplay *display;
+
+ display = gdm_display_store_find (store,
+ lookup_by_session_id,
+ (gpointer) login_session_id);
+ if (display != NULL && gdm_display_get_status (display) == GDM_DISPLAY_MANAGED) {
+ g_debug ("GdmLocalDisplayFactory: session %s found, activating.",
+ login_session_id);
+ gdm_activate_session_by_id (factory->priv->connection, seat_id, login_session_id);
+ return NULL;
}
- g_clear_pointer (&active_session_id, g_free);
}
g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id);