diff options
author | msizanoen1 <msizanoen@qtmlabs.xyz> | 2022-03-07 12:03:15 +0700 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2023-05-08 13:50:11 +0000 |
commit | 6184c8a9a113abc963452dd3fdc91d1597385f56 (patch) | |
tree | e1f2c9a4ddbdd0905cda1d6a4024781d3d6ed052 /daemon | |
parent | 8b8f8f05025f91fb76d7669630f7387da1d64772 (diff) | |
download | gdm-6184c8a9a113abc963452dd3fdc91d1597385f56.tar.gz |
daemon: Allow Wayland sessions on non-primary seats
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-local-display-factory.c | 35 | ||||
-rw-r--r-- | daemon/gdm-manager.c | 3 | ||||
-rw-r--r-- | daemon/gdm-session.c | 5 |
3 files changed, 15 insertions, 28 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c index 5b9baebc..b54d4042 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c @@ -758,6 +758,7 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, { gboolean seat_supports_graphics; gboolean is_seat0; + gboolean falling_back; g_auto (GStrv) session_types = NULL; const char *legacy_session_types[] = { "x11", NULL }; GdmDisplay *display = NULL; @@ -828,24 +829,16 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, } is_seat0 = g_strcmp0 (seat_id, "seat0") == 0; - if (is_seat0) { - gboolean falling_back; - falling_back = factory->num_failures > 0; - session_types = gdm_local_display_factory_get_session_types (factory, falling_back); + falling_back = factory->num_failures > 0; + session_types = gdm_local_display_factory_get_session_types (factory, falling_back); - 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" : ""); - } + if (session_types == NULL) { + g_debug ("GdmLocalDisplayFactory: Both Wayland and Xorg are unavailable"); + seat_supports_graphics = FALSE; } else { - g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id); - /* Force legacy X11 for all auxiliary seats */ - seat_supports_graphics = TRUE; - session_types = g_strdupv ((char **) legacy_session_types); + g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", + session_types[0], falling_back? " fallback" : ""); } /* For seat0, we have a fallback logic to still try starting it after @@ -907,13 +900,11 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, #ifdef ENABLE_USER_DISPLAY_SERVER if (g_strcmp0 (preferred_display_server, "wayland") == 0 || g_strcmp0 (preferred_display_server, "xorg") == 0) { - if (is_seat0) { - display = gdm_local_display_new (); - g_object_set (G_OBJECT (display), - "session-type", session_types[0], - "supported-session-types", session_types, - NULL); - } + display = gdm_local_display_new (); + g_object_set (G_OBJECT (display), + "session-type", session_types[0], + "supported-session-types", session_types, + NULL); } #endif diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c index 8611e2ed..b08b564a 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -1644,8 +1644,7 @@ create_display_for_user_session (GdmManager *self, const char *session_id) { GdmDisplay *display; - /* at the moment we only create GdmLocalDisplay objects on seat0 */ - const char *seat_id = "seat0"; + g_autofree const char *seat_id = gdm_session_get_display_seat_id (session); display = gdm_local_display_new (); diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c index 0b438651..ebb9213d 100644 --- a/daemon/gdm-session.c +++ b/daemon/gdm-session.c @@ -3363,11 +3363,8 @@ gdm_session_get_display_mode (GdmSession *self) self->is_program_session? "yes" : "no", self->display_seat_id); - /* Non-seat0 sessions share their X server with their login screen - * for now. - */ if (g_strcmp0 (self->display_seat_id, "seat0") != 0) { - return GDM_SESSION_DISPLAY_MODE_REUSE_VT; + return GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED; } #ifdef ENABLE_USER_DISPLAY_SERVER |