~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to src/display.c

  • Committer: robert.ancell at canonical
  • Date: 2011-02-13 08:34:29 UTC
  • Revision ID: robert.ancell@canonical.com-20110213083429-yrb65hhc8gsi8370
Split child process code out from session/xserver

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
            g_debug ("pam_env[%d]=%s", i, pam_env[i]);
383
383
            gchar **pam_env_vars = g_strsplit (pam_env[i], "=", 2);
384
384
            if (pam_env_vars && pam_env_vars[0] && pam_env_vars[1])
385
 
                session_set_env (session, pam_env_vars[0], pam_env_vars[1]);
 
385
                child_process_set_env (CHILD_PROCESS (session), pam_env_vars[0], pam_env_vars[1]);
386
386
            else
387
387
                g_warning ("Can't parse PAM environment variable %s", pam_env[i]);
388
388
            g_strfreev (pam_env_vars);
400
400
    if (!value)
401
401
        return;
402
402
 
403
 
    session_set_env (session, name, value);
 
403
    child_process_set_env (CHILD_PROCESS (session), name, value);
404
404
    g_free (value);
405
405
}
406
406
 
493
493
 
494
494
            g_signal_connect (G_OBJECT (display->priv->user_session), "exited", G_CALLBACK (user_session_exited_cb), display);
495
495
            g_signal_connect (G_OBJECT (display->priv->user_session), "killed", G_CALLBACK (user_session_killed_cb), display);
496
 
            session_set_env (display->priv->user_session, "DISPLAY", xserver_get_address (display->priv->xserver));
 
496
            child_process_set_env (CHILD_PROCESS (display->priv->user_session), "DISPLAY", xserver_get_address (display->priv->xserver));
497
497
            if (display->priv->user_ck_session)
498
 
                session_set_env (display->priv->user_session, "XDG_SESSION_COOKIE", ck_connector_get_cookie (display->priv->user_ck_session));
499
 
            session_set_env (display->priv->user_session, "DESKTOP_SESSION", session); // FIXME: Apparently deprecated?
500
 
            session_set_env (display->priv->user_session, "GDMSESSION", session); // FIXME: Not cross-desktop
 
498
                child_process_set_env (CHILD_PROCESS (display->priv->user_session), "XDG_SESSION_COOKIE", ck_connector_get_cookie (display->priv->user_ck_session));
 
499
            child_process_set_env (CHILD_PROCESS (display->priv->user_session), "DESKTOP_SESSION", session); // FIXME: Apparently deprecated?
 
500
            child_process_set_env (CHILD_PROCESS (display->priv->user_session), "GDMSESSION", session); // FIXME: Not cross-desktop
501
501
            set_env_from_keyfile (display->priv->user_session, "LANG", dmrc_file, "Desktop", "Language");
502
502
            set_env_from_keyfile (display->priv->user_session, "LANGUAGE", dmrc_file, "Desktop", "Langlist");
503
503
            set_env_from_keyfile (display->priv->user_session, "LC_MESSAGES", dmrc_file, "Desktop", "LCMess");
504
 
            //session_set_env (display->priv->user_session, "GDM_LANG", session_language); // FIXME: Not cross-desktop
 
504
            //child_process_set_env (CHILD_PROCESS (display->priv->user_session), "GDM_LANG", session_language); // FIXME: Not cross-desktop
505
505
            set_env_from_keyfile (display->priv->user_session, "GDM_KEYBOARD_LAYOUT", dmrc_file, "Desktop", "Layout"); // FIXME: Not cross-desktop
506
506
            set_env_from_pam_session (display->priv->user_session, display->priv->user_pam_session);
507
507
 
648
648
        display->priv->greeter_session = session_new (username, command);
649
649
        g_signal_connect (G_OBJECT (display->priv->greeter_session), "exited", G_CALLBACK (greeter_session_exited_cb), display);
650
650
        g_signal_connect (G_OBJECT (display->priv->greeter_session), "killed", G_CALLBACK (greeter_session_killed_cb), display);
651
 
        session_set_env (display->priv->greeter_session, "DISPLAY", xserver_get_address (display->priv->xserver));
 
651
        child_process_set_env (CHILD_PROCESS (display->priv->greeter_session), "DISPLAY", xserver_get_address (display->priv->xserver));
652
652
        if (display->priv->greeter_ck_session)
653
 
            session_set_env (display->priv->greeter_session, "XDG_SESSION_COOKIE", ck_connector_get_cookie (display->priv->greeter_ck_session));
 
653
            child_process_set_env (CHILD_PROCESS (display->priv->greeter_session), "XDG_SESSION_COOKIE", ck_connector_get_cookie (display->priv->greeter_ck_session));
654
654
        set_env_from_pam_session (display->priv->greeter_session, display->priv->greeter_pam_session);
655
655
 
656
656
        g_signal_emit (display, signals[START_GREETER], 0, display->priv->greeter_session);