[gdm/fix-jump-back-to-login-screen: 6/21] local-display-factory: Don't crash if Xorg and Wayland are both unavailable




commit bb4f373f1eb743d33693fbd6f85a8326db3d4d27
Author: Ray Strode <rstrode redhat com>
Date:   Thu Oct 7 15:34:27 2021 -0400

    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

 daemon/gdm-local-display-factory.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index eba386712..120847f95 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -678,8 +678,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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]