[gdm] session: run logind managed displays through session wrappers
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] session: run logind managed displays through session wrappers
- Date: Wed, 18 Feb 2015 22:46:07 +0000 (UTC)
commit 529d1aaa957549b834c0c3b98f2bec0a52318c07
Author: Ray Strode <rstrode redhat com>
Date: Mon Jan 19 19:11:17 2015 -0500
session: run logind managed displays through session wrappers
Now that we have a utility for starting a wayland session
(and registering it with GDM) we should use the tool.
Now that we have a utility for starting an X server from within the
user session, we can support the LOGIND_MANAGED display mode for X sessions,
in a similar way to how we support wayland sessions on a new vt.
This commit adds the plumbing necessary to use the new tools.
https://bugzilla.gnome.org/show_bug.cgi?id=744764
daemon/gdm-session.c | 48 ++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 44 insertions(+), 4 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 747e156..1726490 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -54,6 +54,9 @@
#include "gdm-session-worker-glue.h"
#include "gdm-common.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
#define GDM_SESSION_DBUS_ERROR_CANCEL "org.gnome.DisplayManager.Session.Error.Cancel"
#define GDM_SESSION_DBUS_OBJECT_PATH "/org/gnome/DisplayManager/Session"
@@ -2543,8 +2546,12 @@ gdm_session_start_session (GdmSession *self,
const char *service_name)
{
GdmSessionConversation *conversation;
- char *command;
- char *program;
+ GdmSessionDisplayMode display_mode;
+ gboolean is_x11 = TRUE;
+ gboolean run_launcher = FALSE;
+ gboolean allow_remote_connections = FALSE;
+ char *command;
+ char *program;
g_return_if_fail (GDM_IS_SESSION (self));
g_return_if_fail (self->priv->session_conversation == NULL);
@@ -2559,13 +2566,46 @@ gdm_session_start_session (GdmSession *self,
stop_all_other_conversations (self, conversation, FALSE);
+ display_mode = gdm_session_get_display_mode (self);
+
+#ifdef ENABLE_WAYLAND_SUPPORT
+ is_x11 = !gdm_session_is_wayland_session (self);
+#endif
+
+ if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
+ display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
+ run_launcher = TRUE;
+ }
+
if (self->priv->selected_program == NULL) {
+ gboolean run_xsession_script;
+
command = get_session_command (self);
- if (gdm_session_bypasses_xsession (self)) {
- program = g_strdup (command);
+ run_xsession_script = !gdm_session_bypasses_xsession (self);
+
+ if (self->priv->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\"",
+ run_xsession_script? "--run-script " : "",
+ allow_remote_connections?
"--allow-remote-connections " : "",
+ command);
+ } else {
+ program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session \"%s\"",
+ command);
+ }
+ } else if (run_xsession_script) {
program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
+ } else {
+ program = g_strdup (command);
}
g_free (command);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]