Blame SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch

3b7e70
From 874b26e3674d540df37d7f145df853bcf81e5a26 Mon Sep 17 00:00:00 2001
3c0833
From: Ray Strode <rstrode@redhat.com>
3c0833
Date: Wed, 5 Feb 2020 15:20:48 -0500
3b7e70
Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats
3c0833
3c0833
GNOME doesn't deal very well with multiple sessions
3c0833
running on a multiple seats at the moment.
3c0833
3c0833
Until that's fixed, ensure sessions run on auxillary
3c0833
seats get their own session bus.
3c0833
---
3b7e70
 daemon/gdm-session.c | 11 ++++++++++-
3b7e70
 1 file changed, 10 insertions(+), 1 deletion(-)
3c0833
3c0833
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
3b7e70
index 418240dc0..77d6b8ff0 100644
3c0833
--- a/daemon/gdm-session.c
3c0833
+++ b/daemon/gdm-session.c
3b7e70
@@ -2822,119 +2822,128 @@ on_start_program_cb (GdmDBusWorker *worker,
3c0833
         if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
3c0833
             g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
3c0833
                 return;
3c0833
 
3c0833
         self = conversation->session;
3c0833
         service_name = conversation->service_name;
3c0833
 
3c0833
         if (worked) {
3b7e70
                 self->session_pid = pid;
3b7e70
                 self->session_conversation = conversation;
3c0833
 
3c0833
                 g_debug ("GdmSession: Emitting 'session-started' signal with pid '%d'", pid);
3c0833
                 g_signal_emit (self, signals[SESSION_STARTED], 0, service_name, pid);
3c0833
         } else {
3c0833
                 gdm_session_stop_conversation (self, service_name);
3c0833
 
3c0833
                 g_debug ("GdmSession: Emitting 'session-start-failed' signal");
3c0833
                 g_signal_emit (self, signals[SESSION_START_FAILED], 0, service_name, error->message);
3c0833
         }
3c0833
 }
3c0833
 
3c0833
 void
3c0833
 gdm_session_start_session (GdmSession *self,
3c0833
                            const char *service_name)
3c0833
 {
3c0833
         GdmSessionConversation *conversation;
3c0833
         GdmSessionDisplayMode   display_mode;
3c0833
         gboolean                is_x11 = TRUE;
3c0833
         gboolean                run_launcher = FALSE;
3c0833
         gboolean                allow_remote_connections = FALSE;
3c0833
+        gboolean                run_separate_bus = FALSE;
3c0833
         char                   *command;
3c0833
         char                   *program;
3b7e70
         gboolean               register_session;
3c0833
 
3c0833
         g_return_if_fail (GDM_IS_SESSION (self));
3b7e70
         g_return_if_fail (self->session_conversation == NULL);
3c0833
 
3c0833
         conversation = find_conversation_by_name (self, service_name);
3c0833
 
3c0833
         if (conversation == NULL) {
3c0833
                 g_warning ("GdmSession: Tried to start session of "
3c0833
                            "nonexistent conversation %s", service_name);
3c0833
                 return;
3c0833
         }
3c0833
 
3c0833
         stop_all_other_conversations (self, conversation, FALSE);
3c0833
 
3c0833
         display_mode = gdm_session_get_display_mode (self);
3c0833
 
3c0833
 #ifdef ENABLE_WAYLAND_SUPPORT
3b7e70
         is_x11 = g_strcmp0 (self->session_type, "wayland") != 0;
3c0833
 #endif
3c0833
 
3c0833
         if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
3c0833
             display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
3c0833
                 run_launcher = TRUE;
3c0833
         }
3c0833
 
3b7e70
         register_session = !gdm_session_session_registers (self);
3b7e70
 
3b7e70
+        if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
3c0833
+                run_separate_bus = TRUE;
3c0833
+        }
3c0833
+
3b7e70
         if (self->selected_program == NULL) {
3c0833
                 gboolean run_xsession_script;
3c0833
 
3c0833
                 command = get_session_command (self);
3c0833
 
3c0833
                 run_xsession_script = !gdm_session_bypasses_xsession (self);
3c0833
 
3b7e70
                 if (self->display_is_local) {
3c0833
                         gboolean disallow_tcp = TRUE;
3c0833
                         gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
3c0833
                         allow_remote_connections = !disallow_tcp;
3c0833
                 } else {
3c0833
                         allow_remote_connections = TRUE;
3c0833
                 }
3c0833
 
3c0833
                 if (run_launcher) {
3c0833
                         if (is_x11) {
3b7e70
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
3b7e70
                                                            register_session ? "--register-session " : "",
3c0833
                                                            run_xsession_script? "--run-script " : "",
3c0833
                                                            allow_remote_connections? "--allow-remote-connections " : "",
3c0833
                                                            command);
3c0833
                         } else {
3b7e70
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
3b7e70
                                                            register_session ? "--register-session " : "",
3c0833
                                                            command);
3c0833
                         }
3c0833
                 } else if (run_xsession_script) {
3c0833
-                        program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
3b7e70
+                        if (run_separate_bus) {
3b7e70
+                                program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
3b7e70
+                        } else {
3b7e70
+                                program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
3b7e70
+                        }
3c0833
                 } else {
3c0833
                         program = g_strdup (command);
3c0833
                 }
3c0833
 
3c0833
                 g_free (command);
3c0833
         } else {
3b7e70
                 /* FIXME:
3b7e70
                  * Always use a separate DBus bus for each greeter session.
3b7e70
                  * Firstly, this means that if we run multiple greeter session
3b7e70
                  * (which we really should not do, but have to currently), then
3b7e70
                  * each one will get its own DBus session bus.
3b7e70
                  * But, we also explicitly do this for seat0, because that way
3b7e70
                  * it cannot make use of systemd to run the GNOME session. This
3b7e70
                  * prevents the session lookup logic from getting confused.
3b7e70
                  * This has a similar effect as passing --builtin to gnome-session.
3b7e70
                  *
3b7e70
                  * We really should not be doing this. But the fix is to use
3b7e70
                  * separate dynamically created users and that requires some
3b7e70
                  * major refactorings.
3b7e70
                  */
3c0833
                 if (run_launcher) {
3c0833
                         if (is_x11) {
3b7e70
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
3b7e70
                                                            register_session ? "--register-session " : "",
3b7e70
                                                            self->selected_program);
3c0833
                         } else {
3b7e70
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
3b7e70
                                                            register_session ? "--register-session " : "",
3b7e70
                                                            self->selected_program);
3c0833
                         }
3c0833
-- 
3b7e70
2.30.1
3c0833