summaryrefslogtreecommitdiff
path: root/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch
blob: 000b95c70612203b88c4077bc51be06550652886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
From ea1de1173b46f76fe00b4f52b2b71ad16e35acc3 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 5 Feb 2020 15:20:48 -0500
Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats

GNOME doesn't deal very well with multiple sessions
running on a multiple seats at the moment.

Until that's fixed, ensure sessions run on auxillary
seats get their own session bus.
---
 daemon/gdm-session.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index a65fa0f9..f13b54af 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -2864,119 +2864,128 @@ on_start_program_cb (GdmDBusWorker *worker,
         if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
             g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
                 return;
 
         self = conversation->session;
         service_name = conversation->service_name;
 
         if (worked) {
                 self->session_pid = pid;
                 self->session_conversation = conversation;
 
                 g_debug ("GdmSession: Emitting 'session-started' signal with pid '%d'", pid);
                 g_signal_emit (self, signals[SESSION_STARTED], 0, service_name, pid);
         } else {
                 gdm_session_stop_conversation (self, service_name);
 
                 g_debug ("GdmSession: Emitting 'session-start-failed' signal");
                 g_signal_emit (self, signals[SESSION_START_FAILED], 0, service_name, error->message);
         }
 }
 
 void
 gdm_session_start_session (GdmSession *self,
                            const char *service_name)
 {
         GdmSessionConversation *conversation;
         GdmSessionDisplayMode   display_mode;
         gboolean                is_x11 = TRUE;
         gboolean                run_launcher = FALSE;
         gboolean                allow_remote_connections = FALSE;
+        gboolean                run_separate_bus = FALSE;
         char                   *command;
         char                   *program;
         gboolean               register_session;
 
         g_return_if_fail (GDM_IS_SESSION (self));
         g_return_if_fail (self->session_conversation == NULL);
 
         conversation = find_conversation_by_name (self, service_name);
 
         if (conversation == NULL) {
                 g_warning ("GdmSession: Tried to start session of "
                            "nonexistent conversation %s", service_name);
                 return;
         }
 
         stop_all_other_conversations (self, conversation, FALSE);
 
         display_mode = gdm_session_get_display_mode (self);
 
 #ifdef ENABLE_WAYLAND_SUPPORT
         is_x11 = g_strcmp0 (self->session_type, "wayland") != 0;
 #endif
 
         if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
             display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
                 run_launcher = TRUE;
         }
 
         register_session = !gdm_session_session_registers (self);
 
+        if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
+                run_separate_bus = TRUE;
+        }
+
         if (self->selected_program == NULL) {
                 gboolean run_xsession_script;
 
                 command = get_session_command (self);
 
                 run_xsession_script = !gdm_session_bypasses_xsession (self);
 
                 if (self->display_is_local) {
                         gboolean disallow_tcp = TRUE;
                         gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
                         allow_remote_connections = !disallow_tcp;
                 } else {
                         allow_remote_connections = TRUE;
                 }
 
                 if (run_launcher) {
                         if (is_x11) {
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
                                                            register_session ? "--register-session " : "",
                                                            run_xsession_script? "--run-script " : "",
                                                            allow_remote_connections? "--allow-remote-connections " : "",
                                                            command);
                         } else {
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
                                                            register_session ? "--register-session " : "",
                                                            command);
                         }
                 } else if (run_xsession_script) {
-                        program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
+                        if (run_separate_bus) {
+                                program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
+                        } else {
+                                program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
+                        }
                 } else {
                         program = g_strdup (command);
                 }
 
                 g_free (command);
         } else {
                 /* FIXME:
                  * Always use a separate DBus bus for each greeter session.
                  * Firstly, this means that if we run multiple greeter session
                  * (which we really should not do, but have to currently), then
                  * each one will get its own DBus session bus.
                  * But, we also explicitly do this for seat0, because that way
                  * it cannot make use of systemd to run the GNOME session. This
                  * prevents the session lookup logic from getting confused.
                  * This has a similar effect as passing --builtin to gnome-session.
                  *
                  * We really should not be doing this. But the fix is to use
                  * separate dynamically created users and that requires some
                  * major refactorings.
                  */
                 if (run_launcher) {
                         if (is_x11) {
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
                                                            register_session ? "--register-session " : "",
                                                            self->selected_program);
                         } else {
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
                                                            register_session ? "--register-session " : "",
                                                            self->selected_program);
                         }
-- 
2.37.3