diff options
author | Ray Strode <rstrode@redhat.com> | 2018-08-09 12:32:31 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2018-08-09 12:57:24 -0400 |
commit | cf8d918f3dfb2a11ff357275d1d16eaa3f8116c0 (patch) | |
tree | 36c05e4d3572ccea3e5f76566b3e81413c41f730 | |
parent | 11fe198ebdfaa0cbe11ac9f4c4c1045e3d01c675 (diff) | |
download | gdm-cf8d918f3dfb2a11ff357275d1d16eaa3f8116c0.tar.gz |
local-display-factory: don't jump to failed display
Since commit 5e737a57 `create_display` will jump to any
already running login screen if it can find one.
Right now if a display fails we call `create_display` to
create a new one. It will look for any already running
login screen and find the recently failed display.
This commit make sure we never jump to a display that isn't
in good working order.
-rw-r--r-- | daemon/gdm-local-display-factory.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c index 82169ce4..cf6c42a2 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c @@ -87,6 +87,9 @@ static void on_display_status_changed (GdmDisplay static gboolean gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory); static gpointer local_display_factory_object = NULL; +static gboolean lookup_by_session_id (const char *id, + GdmDisplay *display, + gpointer user_data); G_DEFINE_TYPE (GdmLocalDisplayFactory, gdm_local_display_factory, GDM_TYPE_DISPLAY_FACTORY) @@ -392,12 +395,20 @@ create_display (GdmLocalDisplayFactory *factory, /* If we already have a login window, switch to it */ if (gdm_get_login_window_session_id (seat_id, &login_session_id)) { - if (g_strcmp0 (active_session_id, login_session_id) != 0) { - gdm_activate_session_by_id (factory->priv->connection, 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) { + 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); - return NULL; } g_clear_pointer (&active_session_id, g_free); } else if (!sd_seat_can_multi_session (seat_id)) { |