diff options
author | Ray Strode <rstrode@redhat.com> | 2021-10-07 15:34:27 -0400 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2021-12-22 21:22:03 +0000 |
commit | 8c03f26dcd0e37fc8fd4fa567b6e60864d694c3e (patch) | |
tree | 95a355ddf02263bcdc15560c70cd31ba67264745 /daemon | |
parent | c6e833c2fddcfc3b42dae2ae6250c5add443e1a7 (diff) | |
download | gdm-8c03f26dcd0e37fc8fd4fa567b6e60864d694c3e.tar.gz |
local-display-factory: Don't crash if Xorg and Wayland are both unavailable
At the moment if Wayland doesn't work, the login screen will fall back
to Xorg, and if Xorg doesn't work the login screen will fall back to
Wayland.
But if the fall back choice is disabled explicitly, GDM will just crash.
This commit fixes the crash.
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/739
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-local-display-factory.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c index 5fbbad68..c00e1c47 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c @@ -684,8 +684,13 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, falling_back = factory->num_failures > 0; session_types = gdm_local_display_factory_get_session_types (factory, falling_back); - g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", - session_types[0], falling_back? " fallback" : ""); + if (session_types == NULL) { + g_debug ("GdmLocalDisplayFactory: Both Wayland and Xorg are unavailable"); + seat_supports_graphics = FALSE; + } else { + g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", + session_types[0], falling_back? " fallback" : ""); + } } else { is_seat0 = FALSE; |