summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <halfline@gmail.com>2021-07-28 16:32:00 +0000
committerRay Strode <halfline@gmail.com>2021-07-28 16:32:00 +0000
commit5f964bcb8048ebf30ee0293ff5faab4a75342cf7 (patch)
treea73b88798eb94ace5ee21b2610ded6bd498d1e6d
parent3d25d1933ace46430cf2b479d3fe9302ff14efb7 (diff)
parentb1367915672ea51c99b21ac764a8452d0529a5ea (diff)
downloadgdm-5f964bcb8048ebf30ee0293ff5faab4a75342cf7.tar.gz
Merge branch 'session-selection-again' into 'master'
Another round of fixes related to the nvidia changes See merge request GNOME/gdm!151
-rw-r--r--daemon/gdm-manager.c16
-rw-r--r--daemon/gdm-session.c19
2 files changed, 17 insertions, 18 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index e433acf3..4c2752fe 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1333,7 +1333,7 @@ set_up_automatic_login_session (GdmManager *manager,
GdmDisplay *display)
{
GdmSession *session;
- char *display_session_type = NULL;
+ g_auto (GStrv) supported_session_types = NULL;
/* 0 is root user; since the daemon talks to the session object
* directly, itself, for automatic login
@@ -1342,11 +1342,12 @@ set_up_automatic_login_session (GdmManager *manager,
session = get_user_session_for_display (display);
g_object_get (G_OBJECT (display),
- "session-type", &display_session_type,
+ "supported-session-types", &supported_session_types,
NULL);
g_object_set (G_OBJECT (session),
"display-is-initial", FALSE,
+ "supported-session-types", supported_session_types,
NULL);
g_debug ("GdmManager: Starting automatic login conversation");
@@ -2305,9 +2306,7 @@ create_user_session_for_display (GdmManager *manager,
char *display_auth_file = NULL;
char *display_seat_id = NULL;
char *display_id = NULL;
-#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
- g_autofree char *display_session_type = NULL;
-#endif
+ g_auto (GStrv) supported_session_types = NULL;
g_object_get (G_OBJECT (display),
"id", &display_id,
@@ -2316,9 +2315,7 @@ create_user_session_for_display (GdmManager *manager,
"remote-hostname", &remote_hostname,
"x11-authority-file", &display_auth_file,
"seat-id", &display_seat_id,
-#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
- "session-type", &display_session_type,
-#endif
+ "supported-session-types", &supported_session_types,
NULL);
display_device = get_display_device (manager, display);
@@ -2331,6 +2328,9 @@ create_user_session_for_display (GdmManager *manager,
display_auth_file,
display_is_local,
NULL);
+ g_object_set (G_OBJECT (session),
+ "supported-session-types", supported_session_types,
+ NULL);
g_debug ("GdmSession: Created user session for user %d on display %s (seat %s)",
(int) allowed_user,
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index dcdbb40a..11762bfb 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -378,7 +378,7 @@ get_system_session_dirs (GdmSession *self,
for (j = 0; self->supported_session_types[j] != NULL; j++) {
const char *supported_type = self->supported_session_types[j];
- if (g_str_equal (supported_type, "x11") ||
+ if (g_str_equal (supported_type, "x11") &&
(type == NULL || g_str_equal (type, supported_type))) {
for (i = 0; system_data_dirs[i]; i++) {
gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
@@ -388,8 +388,9 @@ get_system_session_dirs (GdmSession *self,
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
}
+
#ifdef ENABLE_WAYLAND_SUPPORT
- if (g_str_equal (supported_type, "wayland") ||
+ if (g_str_equal (supported_type, "wayland") &&
(type == NULL || g_str_equal (type, supported_type))) {
for (i = 0; system_data_dirs[i]; i++) {
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
@@ -3203,21 +3204,19 @@ gdm_session_is_wayland_session (GdmSession *self)
{
GKeyFile *key_file;
gboolean is_wayland_session = FALSE;
- char *filename;
- char *full_path = NULL;
+ char *filename;
+ g_autofree char *full_path = NULL;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
filename = get_session_filename (self);
- if (supports_session_type (self, "wayland")) {
- key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
+ key_file = load_key_file_for_file (self, filename, NULL, &full_path);
- if (key_file == NULL) {
- goto out;
- }
- }
+ if (key_file == NULL) {
+ goto out;
+ }
if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
is_wayland_session = TRUE;