return greeter_session;
}
-static Session *
-seat_unity_create_session (Seat *seat)
-{
- Session *session;
-
- session = session_new ();
- session_set_env (session, "XDG_SEAT", "seat0");
- if (!SEAT_UNITY (seat)->priv->use_vt_switching)
- {
- gchar *value = g_strdup_printf ("%d", SEAT_UNITY (seat)->priv->vt);
- session_set_env (SESSION (session), "XDG_VTNR", value);
- g_free (value);
- }
-
- return session;
-}
-
static void
seat_unity_set_active_session (Seat *seat, Session *session)
{
return SEAT_UNITY (seat)->priv->active_session;
}
+static Session *
+seat_unity_create_session (Seat *seat, Session *user_session)
+{
+ Session *session;
+
+ session = session_new ();
+ session_set_env (session, "XDG_SEAT", "seat0");
+ if (!SEAT_UNITY (seat)->priv->use_vt_switching)
+ {
+ gchar *value = g_strdup_printf ("%d", SEAT_UNITY (seat)->priv->vt);
+ session_set_env (SESSION (session), "XDG_VTNR", value);
+ g_free (value);
+
+ /* Notify compositor that user's session should be displayed under
+ greeter. Note that we actually just set the active session, because
+ the compositor should know to always keep the greeter above any
+ sessions. So we are only adjusting the session relative to other
+ user sessions. */
+ if (user_session != NULL)
+ seat_unity_set_active_session (seat, user_session);
+ }
+
+ return session;
+}
+
static void
seat_unity_run_script (Seat *seat, DisplayServer *display_server, Process *script)
{