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

3c0833
From 84b823187c8e0b23274cd1a93f4e47a2c585c75b Mon Sep 17 00:00:00 2001
3c0833
From: Ray Strode <rstrode@redhat.com>
3c0833
Date: Wed, 5 Feb 2020 15:20:48 -0500
3c0833
Subject: [PATCH 2/2] 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
---
3c0833
 daemon/gdm-session.c | 17 +++++++++++++----
3c0833
 1 file changed, 13 insertions(+), 4 deletions(-)
3c0833
3c0833
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
3c0833
index a8263ba11..55637b378 100644
3c0833
--- a/daemon/gdm-session.c
3c0833
+++ b/daemon/gdm-session.c
3c0833
@@ -2846,130 +2846,139 @@ 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) {
3c0833
                 self->priv->session_pid = pid;
3c0833
                 self->priv->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;
3c0833
 
3c0833
         g_return_if_fail (GDM_IS_SESSION (self));
3c0833
         g_return_if_fail (self->priv->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
3c0833
         is_x11 = g_strcmp0 (self->priv->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
 
3c0833
+        if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0 && !run_launcher) {
3c0833
+                run_separate_bus = TRUE;
3c0833
+        }
3c0833
+
3c0833
         if (self->priv->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
 
3c0833
                 if (self->priv->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) {
3c0833
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s %s\"%s\"",
3c0833
                                                            run_xsession_script? "--run-script " : "",
3c0833
                                                            allow_remote_connections? "--allow-remote-connections " : "",
3c0833
                                                            command);
3c0833
                         } else {
3c0833
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
3c0833
                                                            command);
3c0833
                         }
3c0833
                 } else if (run_xsession_script) {
3c0833
-                        program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
3c0833
+                    if (run_separate_bus) {
3c0833
+                            program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
3c0833
+                    } else {
3c0833
+                            program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
3c0833
+                    }
3c0833
                 } else {
3c0833
                         program = g_strdup (command);
3c0833
                 }
3c0833
 
3c0833
                 g_free (command);
3c0833
         } else {
3c0833
                 if (run_launcher) {
3c0833
                         if (is_x11) {
3c0833
-                                program = g_strdup_printf (LIBEXECDIR "/gdm-x-session \"%s\"",
3c0833
-                                                           self->priv->selected_program);
3c0833
+                            program = g_strdup_printf (LIBEXECDIR "/gdm-x-session \"%s\"",
3c0833
+                                                       self->priv->selected_program);
3c0833
                         } else {
3c0833
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
3c0833
                                                            self->priv->selected_program);
3c0833
                         }
3c0833
                 } else {
3c0833
-                        if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0) {
3c0833
+                        if (run_separate_bus) {
3c0833
                                 program = g_strdup_printf ("dbus-run-session -- %s",
3c0833
                                                            self->priv->selected_program);
3c0833
                         } else {
3c0833
                                 program = g_strdup (self->priv->selected_program);
3c0833
                         }
3c0833
                 }
3c0833
         }
3c0833
 
3c0833
         set_up_session_environment (self);
3c0833
         send_environment (self, conversation);
3c0833
 
3c0833
         gdm_dbus_worker_call_start_program (conversation->worker_proxy,
3c0833
                                             program,
3c0833
                                             conversation->worker_cancellable,
3c0833
                                             (GAsyncReadyCallback) on_start_program_cb,
3c0833
                                             conversation);
3c0833
         g_free (program);
3c0833
 }
3c0833
 
3c0833
 static void
3c0833
 stop_all_conversations (GdmSession *self)
3c0833
 {
3c0833
         stop_all_other_conversations (self, NULL, TRUE);
3c0833
 }
3c0833
 
3c0833
 static void
3c0833
 do_reset (GdmSession *self)
3c0833
 {
3c0833
         stop_all_conversations (self);
3c0833
 
3c0833
-- 
3c0833
2.21.1
3c0833