|
|
f83012 |
From 84b823187c8e0b23274cd1a93f4e47a2c585c75b Mon Sep 17 00:00:00 2001
|
|
|
f83012 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
f83012 |
Date: Wed, 5 Feb 2020 15:20:48 -0500
|
|
|
f83012 |
Subject: [PATCH 2/2] gdm-x-session: run session bus on non-seat0 seats
|
|
|
f83012 |
|
|
|
f83012 |
GNOME doesn't deal very well with multiple sessions
|
|
|
f83012 |
running on a multiple seats at the moment.
|
|
|
f83012 |
|
|
|
f83012 |
Until that's fixed, ensure sessions run on auxillary
|
|
|
f83012 |
seats get their own session bus.
|
|
|
f83012 |
---
|
|
|
f83012 |
daemon/gdm-session.c | 17 +++++++++++++----
|
|
|
f83012 |
1 file changed, 13 insertions(+), 4 deletions(-)
|
|
|
f83012 |
|
|
|
f83012 |
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
|
|
f83012 |
index a8263ba11..55637b378 100644
|
|
|
f83012 |
--- a/daemon/gdm-session.c
|
|
|
f83012 |
+++ b/daemon/gdm-session.c
|
|
|
f83012 |
@@ -2846,130 +2846,139 @@ on_start_program_cb (GdmDBusWorker *worker,
|
|
|
f83012 |
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
|
|
|
f83012 |
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
|
|
f83012 |
return;
|
|
|
f83012 |
|
|
|
f83012 |
self = conversation->session;
|
|
|
f83012 |
service_name = conversation->service_name;
|
|
|
f83012 |
|
|
|
f83012 |
if (worked) {
|
|
|
f83012 |
self->priv->session_pid = pid;
|
|
|
f83012 |
self->priv->session_conversation = conversation;
|
|
|
f83012 |
|
|
|
f83012 |
g_debug ("GdmSession: Emitting 'session-started' signal with pid '%d'", pid);
|
|
|
f83012 |
g_signal_emit (self, signals[SESSION_STARTED], 0, service_name, pid);
|
|
|
f83012 |
} else {
|
|
|
f83012 |
gdm_session_stop_conversation (self, service_name);
|
|
|
f83012 |
|
|
|
f83012 |
g_debug ("GdmSession: Emitting 'session-start-failed' signal");
|
|
|
f83012 |
g_signal_emit (self, signals[SESSION_START_FAILED], 0, service_name, error->message);
|
|
|
f83012 |
}
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
void
|
|
|
f83012 |
gdm_session_start_session (GdmSession *self,
|
|
|
f83012 |
const char *service_name)
|
|
|
f83012 |
{
|
|
|
f83012 |
GdmSessionConversation *conversation;
|
|
|
f83012 |
GdmSessionDisplayMode display_mode;
|
|
|
f83012 |
gboolean is_x11 = TRUE;
|
|
|
f83012 |
gboolean run_launcher = FALSE;
|
|
|
f83012 |
gboolean allow_remote_connections = FALSE;
|
|
|
f83012 |
+ gboolean run_separate_bus = FALSE;
|
|
|
f83012 |
char *command;
|
|
|
f83012 |
char *program;
|
|
|
f83012 |
|
|
|
f83012 |
g_return_if_fail (GDM_IS_SESSION (self));
|
|
|
f83012 |
g_return_if_fail (self->priv->session_conversation == NULL);
|
|
|
f83012 |
|
|
|
f83012 |
conversation = find_conversation_by_name (self, service_name);
|
|
|
f83012 |
|
|
|
f83012 |
if (conversation == NULL) {
|
|
|
f83012 |
g_warning ("GdmSession: Tried to start session of "
|
|
|
f83012 |
"nonexistent conversation %s", service_name);
|
|
|
f83012 |
return;
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
stop_all_other_conversations (self, conversation, FALSE);
|
|
|
f83012 |
|
|
|
f83012 |
display_mode = gdm_session_get_display_mode (self);
|
|
|
f83012 |
|
|
|
f83012 |
#ifdef ENABLE_WAYLAND_SUPPORT
|
|
|
f83012 |
is_x11 = g_strcmp0 (self->priv->session_type, "wayland") != 0;
|
|
|
f83012 |
#endif
|
|
|
f83012 |
|
|
|
f83012 |
if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
|
|
|
f83012 |
display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
|
|
|
f83012 |
run_launcher = TRUE;
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
+ if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0 && !run_launcher) {
|
|
|
f83012 |
+ run_separate_bus = TRUE;
|
|
|
f83012 |
+ }
|
|
|
f83012 |
+
|
|
|
f83012 |
if (self->priv->selected_program == NULL) {
|
|
|
f83012 |
gboolean run_xsession_script;
|
|
|
f83012 |
|
|
|
f83012 |
command = get_session_command (self);
|
|
|
f83012 |
|
|
|
f83012 |
run_xsession_script = !gdm_session_bypasses_xsession (self);
|
|
|
f83012 |
|
|
|
f83012 |
if (self->priv->display_is_local) {
|
|
|
f83012 |
gboolean disallow_tcp = TRUE;
|
|
|
f83012 |
gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
|
|
|
f83012 |
allow_remote_connections = !disallow_tcp;
|
|
|
f83012 |
} else {
|
|
|
f83012 |
allow_remote_connections = TRUE;
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
if (run_launcher) {
|
|
|
f83012 |
if (is_x11) {
|
|
|
f83012 |
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s %s\"%s\"",
|
|
|
f83012 |
run_xsession_script? "--run-script " : "",
|
|
|
f83012 |
allow_remote_connections? "--allow-remote-connections " : "",
|
|
|
f83012 |
command);
|
|
|
f83012 |
} else {
|
|
|
f83012 |
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
|
|
|
f83012 |
command);
|
|
|
f83012 |
}
|
|
|
f83012 |
} else if (run_xsession_script) {
|
|
|
f83012 |
- program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
|
|
f83012 |
+ if (run_separate_bus) {
|
|
|
f83012 |
+ program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
|
|
|
f83012 |
+ } else {
|
|
|
f83012 |
+ program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
|
|
f83012 |
+ }
|
|
|
f83012 |
} else {
|
|
|
f83012 |
program = g_strdup (command);
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
g_free (command);
|
|
|
f83012 |
} else {
|
|
|
f83012 |
if (run_launcher) {
|
|
|
f83012 |
if (is_x11) {
|
|
|
f83012 |
- program = g_strdup_printf (LIBEXECDIR "/gdm-x-session \"%s\"",
|
|
|
f83012 |
- self->priv->selected_program);
|
|
|
f83012 |
+ program = g_strdup_printf (LIBEXECDIR "/gdm-x-session \"%s\"",
|
|
|
f83012 |
+ self->priv->selected_program);
|
|
|
f83012 |
} else {
|
|
|
f83012 |
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
|
|
|
f83012 |
self->priv->selected_program);
|
|
|
f83012 |
}
|
|
|
f83012 |
} else {
|
|
|
f83012 |
- if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0) {
|
|
|
f83012 |
+ if (run_separate_bus) {
|
|
|
f83012 |
program = g_strdup_printf ("dbus-run-session -- %s",
|
|
|
f83012 |
self->priv->selected_program);
|
|
|
f83012 |
} else {
|
|
|
f83012 |
program = g_strdup (self->priv->selected_program);
|
|
|
f83012 |
}
|
|
|
f83012 |
}
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
set_up_session_environment (self);
|
|
|
f83012 |
send_environment (self, conversation);
|
|
|
f83012 |
|
|
|
f83012 |
gdm_dbus_worker_call_start_program (conversation->worker_proxy,
|
|
|
f83012 |
program,
|
|
|
f83012 |
conversation->worker_cancellable,
|
|
|
f83012 |
(GAsyncReadyCallback) on_start_program_cb,
|
|
|
f83012 |
conversation);
|
|
|
f83012 |
g_free (program);
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
static void
|
|
|
f83012 |
stop_all_conversations (GdmSession *self)
|
|
|
f83012 |
{
|
|
|
f83012 |
stop_all_other_conversations (self, NULL, TRUE);
|
|
|
f83012 |
}
|
|
|
f83012 |
|
|
|
f83012 |
static void
|
|
|
f83012 |
do_reset (GdmSession *self)
|
|
|
f83012 |
{
|
|
|
f83012 |
stop_all_conversations (self);
|
|
|
f83012 |
|
|
|
f83012 |
--
|
|
|
f83012 |
2.21.1
|
|
|
f83012 |
|