summaryrefslogtreecommitdiff
path: root/daemon/gdm-launch-environment.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2015-02-18 14:52:50 -0500
committerRay Strode <rstrode@redhat.com>2015-02-18 17:34:16 -0500
commitcafb4c402e41d4adc3124e443d98c10e98924aa2 (patch)
treea87f46fce548673341124f0db58f84c6f63db2c9 /daemon/gdm-launch-environment.c
parentc2769f06b55545a7a7c6217eb41ee403ef016b97 (diff)
downloadgdm-cafb4c402e41d4adc3124e443d98c10e98924aa2.tar.gz
launch-environment: add session-type property
The session-type property is analagous to the sd_login session type. It can be either "x11" or "wayland". This helps us decide whether to start a wayland session or an X session. https://bugzilla.gnome.org/show_bug.cgi?id=744764
Diffstat (limited to 'daemon/gdm-launch-environment.c')
-rw-r--r--daemon/gdm-launch-environment.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
index a11aa9fd..d35e1256 100644
--- a/daemon/gdm-launch-environment.c
+++ b/daemon/gdm-launch-environment.c
@@ -69,6 +69,7 @@ struct GdmLaunchEnvironmentPrivate
char *runtime_dir;
char *session_id;
+ char *session_type;
char *x11_display_name;
char *x11_display_seat_id;
char *x11_display_device;
@@ -80,6 +81,7 @@ struct GdmLaunchEnvironmentPrivate
enum {
PROP_0,
PROP_VERIFICATION_MODE,
+ PROP_SESSION_TYPE,
PROP_X11_DISPLAY_NAME,
PROP_X11_DISPLAY_SEAT_ID,
PROP_X11_DISPLAY_DEVICE,
@@ -505,6 +507,14 @@ gdm_launch_environment_start (GdmLaunchEnvironment *launch_environment)
gdm_session_start_conversation (launch_environment->priv->session, "gdm-launch-environment");
gdm_session_select_program (launch_environment->priv->session, launch_environment->priv->command);
+
+ if (launch_environment->priv->session_type != NULL) {
+ g_object_set (G_OBJECT (launch_environment->priv->session),
+ "session-type",
+ launch_environment->priv->session_type,
+ NULL);
+ }
+
res = TRUE;
out:
if (local_error) {
@@ -553,6 +563,14 @@ _gdm_launch_environment_set_verification_mode (GdmLaunchEnvironment *l
}
static void
+_gdm_launch_environment_set_session_type (GdmLaunchEnvironment *launch_environment,
+ const char *session_type)
+{
+ g_free (launch_environment->priv->session_type);
+ launch_environment->priv->session_type = g_strdup (session_type);
+}
+
+static void
_gdm_launch_environment_set_x11_display_name (GdmLaunchEnvironment *launch_environment,
const char *name)
{
@@ -637,6 +655,9 @@ gdm_launch_environment_set_property (GObject *object,
case PROP_VERIFICATION_MODE:
_gdm_launch_environment_set_verification_mode (self, g_value_get_enum (value));
break;
+ case PROP_SESSION_TYPE:
+ _gdm_launch_environment_set_session_type (self, g_value_get_string (value));
+ break;
case PROP_X11_DISPLAY_NAME:
_gdm_launch_environment_set_x11_display_name (self, g_value_get_string (value));
break;
@@ -684,6 +705,9 @@ gdm_launch_environment_get_property (GObject *object,
case PROP_VERIFICATION_MODE:
g_value_set_enum (value, self->priv->verification_mode);
break;
+ case PROP_SESSION_TYPE:
+ g_value_set_string (value, self->priv->session_type);
+ break;
case PROP_X11_DISPLAY_NAME:
g_value_set_string (value, self->priv->x11_display_name);
break;
@@ -737,6 +761,13 @@ gdm_launch_environment_class_init (GdmLaunchEnvironmentClass *klass)
GDM_SESSION_VERIFICATION_MODE_LOGIN,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class,
+ PROP_SESSION_TYPE,
+ g_param_spec_string ("session-type",
+ NULL,
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
PROP_X11_DISPLAY_NAME,
g_param_spec_string ("x11-display-name",
"name",
@@ -890,6 +921,7 @@ gdm_launch_environment_finalize (GObject *object)
g_free (launch_environment->priv->x11_display_hostname);
g_free (launch_environment->priv->x11_authority_file);
g_free (launch_environment->priv->session_id);
+ g_free (launch_environment->priv->session_type);
G_OBJECT_CLASS (gdm_launch_environment_parent_class)->finalize (object);
}
@@ -899,6 +931,7 @@ create_gnome_session_environment (const char *session_id,
const char *user_name,
const char *display_name,
const char *seat_id,
+ const char *session_type,
const char *display_hostname,
gboolean display_is_local)
{
@@ -934,6 +967,7 @@ create_gnome_session_environment (const char *session_id,
launch_environment = g_object_new (GDM_TYPE_LAUNCH_ENVIRONMENT,
"command", command,
"user-name", user_name,
+ "session-type", session_type,
"x11-display-name", display_name,
"x11-display-seat-id", seat_id,
"x11-display-hostname", display_hostname,
@@ -948,13 +982,22 @@ create_gnome_session_environment (const char *session_id,
GdmLaunchEnvironment *
gdm_create_greeter_launch_environment (const char *display_name,
const char *seat_id,
+ const char *session_type,
const char *display_hostname,
gboolean display_is_local)
{
- return create_gnome_session_environment (NULL,
+ const char *session_name = NULL;
+
+ if (g_strcmp0 (session_type, "wayland") == 0)
+ session_name = "gnome-wayland";
+ else if (g_strcmp0 (session_type, "x11") == 0)
+ session_name = "gnome";
+
+ return create_gnome_session_environment (session_name,
GDM_USERNAME,
display_name,
seat_id,
+ session_type,
display_hostname,
display_is_local);
}
@@ -969,6 +1012,7 @@ gdm_create_initial_setup_launch_environment (const char *display_name,
INITIAL_SETUP_USERNAME,
display_name,
seat_id,
+ NULL,
display_hostname,
display_is_local);
}