diff options
author | Ray Strode <halfline@gmail.com> | 2018-08-15 10:08:03 +0000 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2018-08-15 10:08:03 +0000 |
commit | 21867afde379030e28a3e0b1e92068262d12f43b (patch) | |
tree | 6e6d8807d7f301f95bb84215931688532a4d4a36 | |
parent | 0d64be3204aa63645cd1eb4ca947ba38e52b5864 (diff) | |
parent | d868eb3ced19d0624aa8ce948ccc8d8523551e78 (diff) | |
download | gdm-21867afde379030e28a3e0b1e92068262d12f43b.tar.gz |
Merge branch 'wip/hopefully-fix-startup-problem' into 'master'
local-display-factory: ignore spurios SeatNew signal at start up
Closes #410
See merge request GNOME/gdm!32
-rw-r--r-- | daemon/gdm-local-display-factory.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c index 39f3e30a..7ec998ef 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c @@ -375,6 +375,21 @@ lookup_by_seat_id (const char *id, return res; } +static gboolean +lookup_prepared_display_by_seat_id (const char *id, + GdmDisplay *display, + gpointer user_data) +{ + int status; + + status = gdm_display_get_status (display); + + if (status != GDM_DISPLAY_PREPARED) + return FALSE; + + return lookup_by_seat_id (id, display, user_data); +} + static GdmDisplay * create_display (GdmLocalDisplayFactory *factory, const char *seat_id, @@ -390,6 +405,17 @@ create_display (GdmLocalDisplayFactory *factory, session_type? : "X11", seat_id); store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + if (sd_seat_can_multi_session (seat_id)) + display = gdm_display_store_find (store, lookup_prepared_display_by_seat_id, (gpointer) seat_id); + else + display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id); + + /* Ensure we don't create the same display more than once */ + if (display != NULL) { + g_debug ("GdmLocalDisplayFactory: display already created"); + return NULL; + } + ret = sd_seat_get_active (seat_id, &active_session_id, NULL); if (ret == 0) { @@ -415,13 +441,6 @@ create_display (GdmLocalDisplayFactory *factory, g_clear_pointer (&login_session_id, g_free); } g_clear_pointer (&active_session_id, g_free); - } else if (!sd_seat_can_multi_session (seat_id)) { - /* Ensure we don't create the same display more than once */ - display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id); - - if (display != NULL) { - return NULL; - } } g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id); |