Back to index

lightdm  1.3.2
Classes | Enumerations | Functions | Variables
seat.c File Reference
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include "seat.h"
#include "guest-account.h"

Go to the source code of this file.

Classes

struct  SeatPrivate
struct  SeatModule

Enumerations

enum  { DISPLAY_ADDED, DISPLAY_REMOVED, STOPPED, LAST_SIGNAL }

Functions

 G_DEFINE_TYPE (Seat, seat, G_TYPE_OBJECT)
void seat_register_module (const gchar *name, GType type)
Seatseat_new (const gchar *module_name)
void seat_set_property (Seat *seat, const gchar *name, const gchar *value)
gboolean seat_has_property (Seat *seat, const gchar *name)
const gchar * seat_get_string_property (Seat *seat, const gchar *name)
gboolean seat_get_boolean_property (Seat *seat, const gchar *name)
gint seat_get_integer_property (Seat *seat, const gchar *name)
void seat_set_can_switch (Seat *seat, gboolean can_switch)
gboolean seat_start (Seat *seat)
GList * seat_get_displays (Seat *seat)
void seat_set_active_display (Seat *seat, Display *display)
Displayseat_get_active_display (Seat *seat)
gboolean seat_get_can_switch (Seat *seat)
gboolean seat_get_allow_guest (Seat *seat)
gboolean seat_get_greeter_allow_guest (Seat *seat)
static gboolean switch_to_user (Seat *seat, const gchar *username, gboolean unlock)
static gboolean display_switch_to_user_cb (Display *display, User *user, Seat *seat)
static gboolean display_switch_to_guest_cb (Display *display, Seat *seat)
static const gchar * display_get_guest_username_cb (Display *display, Seat *seat)
static gboolean run_script (Seat *seat, Display *display, const gchar *script_name, User *user)
static void seat_real_run_script (Seat *seat, Display *display, Process *process)
static void emit_upstart_signal (const gchar *signal)
static gboolean display_display_server_ready_cb (Display *display, Seat *seat)
static Sessiondisplay_create_session_cb (Display *display, Seat *seat)
static gboolean display_start_greeter_cb (Display *display, Seat *seat)
static gboolean display_start_session_cb (Display *display, Seat *seat)
static void session_stopped_cb (Session *session, Seat *seat)
static gboolean display_session_started_cb (Display *display, Seat *seat)
static void display_ready_cb (Display *display, Seat *seat)
static void check_stopped (Seat *seat)
static void display_stopped_cb (Display *display, Seat *seat)
static gboolean switch_to_user_or_start_greeter (Seat *seat, const gchar *username, gboolean use_existing, gboolean is_guest, const gchar *session_name, gboolean is_lock, gboolean autologin)
gboolean seat_switch_to_greeter (Seat *seat)
gboolean seat_switch_to_user (Seat *seat, const gchar *username, const gchar *session_name)
gboolean seat_switch_to_guest (Seat *seat, const gchar *session_name)
gboolean seat_lock (Seat *seat, const gchar *username)
void seat_stop (Seat *seat)
gboolean seat_get_is_stopping (Seat *seat)
static void seat_real_setup (Seat *seat)
static gboolean seat_real_start (Seat *seat)
static void seat_real_set_active_display (Seat *seat, Display *display)
static void seat_real_stop (Seat *seat)
static void seat_init (Seat *seat)
static void seat_finalize (GObject *object)
static void seat_class_init (SeatClass *klass)

Variables

static guint signals [LAST_SIGNAL] = { 0 }
static GHashTable * seat_modules = NULL

Class Documentation

struct SeatPrivate

Definition at line 27 of file seat.c.

Collaboration diagram for SeatPrivate:
Class Members
Display * active_display
gboolean can_switch
GList * displays
gchar * guest_username
GHashTable * properties
gboolean stopped
gboolean stopping
struct SeatModule

Definition at line 53 of file seat.c.

Class Members
const gchar * name
GType type

Enumeration Type Documentation

anonymous enum
Enumerator:
DISPLAY_ADDED 
DISPLAY_REMOVED 
STOPPED 
LAST_SIGNAL 

Definition at line 19 of file seat.c.


Function Documentation

static void check_stopped ( Seat seat) [static]

Definition at line 416 of file seat.c.

{
    if (seat->priv->stopping &&
        !seat->priv->stopped &&
        g_list_length (seat->priv->displays) == 0)
    {
        seat->priv->stopped = TRUE;
        g_debug ("Seat stopped");
        g_signal_emit (seat, signals[STOPPED], 0);
    }
}

Here is the caller graph for this function:

static Session* display_create_session_cb ( Display display,
Seat seat 
) [static]

Definition at line 332 of file seat.c.

{
    return SEAT_GET_CLASS (seat)->create_session (seat, display);
}

Here is the caller graph for this function:

static gboolean display_display_server_ready_cb ( Display display,
Seat seat 
) [static]

Definition at line 317 of file seat.c.

{
    const gchar *script;

    /* Run setup script */
    script = seat_get_string_property (seat, "display-setup-script");
    if (script && !run_script (seat, display, script, NULL))
        return FALSE;

    emit_upstart_signal ("login-session-start");

    return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const gchar* display_get_guest_username_cb ( Display display,
Seat seat 
) [static]

Definition at line 233 of file seat.c.

{
    if (seat->priv->guest_username)
        return seat->priv->guest_username;

    seat->priv->guest_username = guest_account_setup ();
    return g_strdup (seat->priv->guest_username);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void display_ready_cb ( Display display,
Seat seat 
) [static]

Definition at line 408 of file seat.c.

{
    /* Switch to this new display */
    g_debug ("New display ready, switching to it");
    SEAT_GET_CLASS (seat)->set_active_display (seat, display);
}

Here is the caller graph for this function:

static gboolean display_session_started_cb ( Display display,
Seat seat 
) [static]

Definition at line 400 of file seat.c.

{
    g_signal_connect (display_get_session (display), "stopped", G_CALLBACK (session_stopped_cb), seat);
    emit_upstart_signal ("desktop-session-start");
    return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean display_start_greeter_cb ( Display display,
Seat seat 
) [static]

Definition at line 338 of file seat.c.

{
    Session *session;
    const gchar *script;

    session = display_get_session (display);

    script = seat_get_string_property (seat, "greeter-setup-script");
    if (script)
        return !run_script (seat, display, script, session_get_user (session));
    else
        return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean display_start_session_cb ( Display display,
Seat seat 
) [static]

Definition at line 353 of file seat.c.

{
    Session *session;
    const gchar *script;

    session = display_get_session (display);

    script = seat_get_string_property (seat, "session-setup-script");
    if (script)
        return !run_script (seat, display, script, session_get_user (session));
    else
        return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void display_stopped_cb ( Display display,
Seat seat 
) [static]

Definition at line 429 of file seat.c.

{
    seat->priv->displays = g_list_remove (seat->priv->displays, display);
    g_signal_handlers_disconnect_matched (display, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
    g_signal_emit (seat, signals[DISPLAY_REMOVED], 0, display);
    g_object_unref (display);

    check_stopped (seat);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean display_switch_to_guest_cb ( Display display,
Seat seat 
) [static]

Definition at line 223 of file seat.c.

{
    /* No guest account */
    if (!seat->priv->guest_username)
        return FALSE;

    return switch_to_user (seat, seat->priv->guest_username, TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean display_switch_to_user_cb ( Display display,
User user,
Seat seat 
) [static]

Definition at line 217 of file seat.c.

{
    return switch_to_user (seat, user_get_name (user), TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void emit_upstart_signal ( const gchar *  signal) [static]

Definition at line 303 of file seat.c.

{
    g_return_if_fail (signal != NULL);
    g_return_if_fail (signal[0] != 0);

    if (getuid () != 0)
        return;

    gchar *cmd = g_strdup_printf ("initctl -q emit %s DISPLAY_MANAGER=lightdm", signal);
    g_spawn_command_line_async (cmd, NULL); /* OK if it fails, probably not installed */
    g_free (cmd);
}

Here is the call graph for this function:

Here is the caller graph for this function:

G_DEFINE_TYPE ( Seat  ,
seat  ,
G_TYPE_OBJECT   
)
static gboolean run_script ( Seat seat,
Display display,
const gchar *  script_name,
User user 
) [static]

Definition at line 243 of file seat.c.

{
    Process *script;
    gboolean result = FALSE;
  
    script = process_new ();

    process_set_command (script, script_name);

    /* Set POSIX variables */
    process_set_clear_environment (script, TRUE);
    process_set_env (script, "SHELL", "/bin/sh");

    /* Variables required for regression tests */
    if (g_getenv ("LIGHTDM_TEST_ROOT"))
    {
        process_set_env (script, "LIGHTDM_TEST_ROOT", g_getenv ("LIGHTDM_TEST_ROOT"));
        process_set_env (script, "LD_PRELOAD", g_getenv ("LD_PRELOAD"));
        process_set_env (script, "LD_LIBRARY_PATH", g_getenv ("LD_LIBRARY_PATH"));
        process_set_env (script, "PATH", g_getenv ("PATH"));
    }
    else
        process_set_env (script, "PATH", "/usr/local/bin:/usr/bin:/bin");

    if (user)
    {
        process_set_env (script, "USER", user_get_name (user));
        process_set_env (script, "LOGNAME", user_get_name (user));
        process_set_env (script, "HOME", user_get_home_directory (user));
    }
    else
        process_set_env (script, "HOME", "/");

    SEAT_GET_CLASS (seat)->run_script (seat, display, script);

    if (process_start (script))
    {
        int exit_status;

        process_wait (script);

        exit_status = process_get_exit_status (script);
        if (WIFEXITED (exit_status))
        {
            g_debug ("Exit status of %s: %d", script_name, WEXITSTATUS (exit_status));
            result = WEXITSTATUS (exit_status) == EXIT_SUCCESS;
        }
    }

    g_object_unref (script);

    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void seat_class_init ( SeatClass klass) [static]

Definition at line 672 of file seat.c.

{
    GObjectClass *object_class = G_OBJECT_CLASS (klass);

    klass->setup = seat_real_setup;
    klass->start = seat_real_start;
    klass->set_active_display = seat_real_set_active_display;
    klass->run_script = seat_real_run_script;
    klass->stop = seat_real_stop;

    object_class->finalize = seat_finalize;

    g_type_class_add_private (klass, sizeof (SeatPrivate));

    signals[DISPLAY_ADDED] =
        g_signal_new ("display-added",
                      G_TYPE_FROM_CLASS (klass),
                      G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (SeatClass, display_added),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__OBJECT,
                      G_TYPE_NONE, 1, DISPLAY_TYPE);
    signals[DISPLAY_REMOVED] =
        g_signal_new ("display-removed",
                      G_TYPE_FROM_CLASS (klass),
                      G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (SeatClass, display_removed),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__OBJECT,
                      G_TYPE_NONE, 1, DISPLAY_TYPE);
    signals[STOPPED] =
        g_signal_new ("stopped",
                      G_TYPE_FROM_CLASS (klass),
                      G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (SeatClass, stopped),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__VOID,
                      G_TYPE_NONE, 0);
}

Here is the call graph for this function:

static void seat_finalize ( GObject *  object) [static]

Definition at line 656 of file seat.c.

{
    Seat *self;

    self = SEAT (object);

    g_hash_table_unref (self->priv->properties);
    g_free (self->priv->guest_username);
    g_list_free_full (self->priv->displays, g_object_unref);
    if (self->priv->active_display)
        g_object_unref (self->priv->active_display);

    G_OBJECT_CLASS (seat_parent_class)->finalize (object);
}

Here is the caller graph for this function:

Definition at line 162 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, NULL);
    return seat->priv->active_display;
}

Here is the caller graph for this function:

gboolean seat_get_allow_guest ( Seat seat)

Definition at line 176 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);  
    return seat_get_boolean_property (seat, "allow-guest") && guest_account_is_installed ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_get_boolean_property ( Seat seat,
const gchar *  name 
)

Definition at line 116 of file seat.c.

{
    return g_strcmp0 (seat_get_string_property (seat, name), "true") == 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_get_can_switch ( Seat seat)

Definition at line 169 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    return seat->priv->can_switch;
}

Here is the caller graph for this function:

GList* seat_get_displays ( Seat seat)

Definition at line 148 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, NULL);
    return seat->priv->displays;
}

Here is the caller graph for this function:

gboolean seat_get_greeter_allow_guest ( Seat seat)

Definition at line 183 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);  
    return seat_get_allow_guest (seat) && seat_get_boolean_property (seat, "greeter-allow-guest");
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint seat_get_integer_property ( Seat seat,
const gchar *  name 
)

Definition at line 122 of file seat.c.

{
    const gchar *value;

    value = seat_get_string_property (seat, name);
    return value ? atoi (value) : 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_get_is_stopping ( Seat seat)

Definition at line 577 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    return seat->priv->stopping;
}

Here is the caller graph for this function:

const gchar* seat_get_string_property ( Seat seat,
const gchar *  name 
)

Definition at line 109 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, NULL);
    return g_hash_table_lookup (seat->priv->properties, name);
}

Here is the caller graph for this function:

gboolean seat_has_property ( Seat seat,
const gchar *  name 
)

Definition at line 102 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    return g_hash_table_lookup (seat->priv->properties, name) != NULL;
}
static void seat_init ( Seat seat) [static]

Definition at line 649 of file seat.c.

{
    seat->priv = G_TYPE_INSTANCE_GET_PRIVATE (seat, SEAT_TYPE, SeatPrivate);
    seat->priv->properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
}
gboolean seat_lock ( Seat seat,
const gchar *  username 
)

Definition at line 552 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);

    if (!seat->priv->can_switch)
        return FALSE;

    g_debug ("Locking seat");
    return switch_to_user_or_start_greeter (seat, username, FALSE, FALSE, NULL, TRUE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Seat* seat_new ( const gchar *  module_name)

Definition at line 77 of file seat.c.

{
    Seat *seat;
    SeatModule *m = NULL;
  
    g_return_val_if_fail (module_name != NULL, NULL);

    if (seat_modules)
        m = g_hash_table_lookup (seat_modules, module_name);
    if (!m)
        return NULL;

    seat = g_object_new (m->type, NULL);

    return seat;
}

Here is the caller graph for this function:

static void seat_real_run_script ( Seat seat,
Display display,
Process process 
) [static]

Definition at line 298 of file seat.c.

{  
}

Here is the caller graph for this function:

static void seat_real_set_active_display ( Seat seat,
Display display 
) [static]

Definition at line 609 of file seat.c.

{
    if (display == seat->priv->active_display)
        return;

    if (seat->priv->active_display)
    {
        /* Stop the existing display if it is a greeter */
        if (!display_get_username (seat->priv->active_display))
        {
            g_debug ("Stopping greeter display being switched from");
            display_stop (seat->priv->active_display);
        }
        /* Otherwise lock it */
        else
        {
            display_lock (seat->priv->active_display);
        }
        g_object_unref (seat->priv->active_display);
    }
    seat->priv->active_display = g_object_ref (display);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void seat_real_setup ( Seat seat) [static]

Definition at line 584 of file seat.c.

{
}

Here is the caller graph for this function:

static gboolean seat_real_start ( Seat seat) [static]

Definition at line 589 of file seat.c.

{
    const gchar *autologin_username;

    g_debug ("Starting seat");

    /* Start showing a greeter */
    autologin_username = seat_get_string_property (seat, "autologin-user");
    if (g_strcmp0 (autologin_username, "") == 0)
        autologin_username = NULL;

    if (autologin_username)
        return switch_to_user_or_start_greeter (seat, autologin_username, TRUE, FALSE, NULL, FALSE, TRUE);
    else if (seat_get_boolean_property (seat, "autologin-guest"))
        return switch_to_user_or_start_greeter (seat, NULL, TRUE, TRUE, NULL, FALSE, TRUE);
    else
        return switch_to_user_or_start_greeter (seat, NULL, TRUE, FALSE, NULL, FALSE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void seat_real_stop ( Seat seat) [static]

Definition at line 633 of file seat.c.

{
    GList *link;

    check_stopped (seat);
    if (seat->priv->stopped)
        return;

    for (link = seat->priv->displays; link; link = link->next)
    {
        Display *display = link->data;
        display_stop (display);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void seat_register_module ( const gchar *  name,
GType  type 
)

Definition at line 61 of file seat.c.

{
    SeatModule *module;

    if (!seat_modules)
        seat_modules = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);

    g_debug ("Registered seat module %s", name);

    module = g_malloc0 (sizeof (SeatModule));
    module->name = g_strdup (name);
    module->type = type;
    g_hash_table_insert (seat_modules, g_strdup (name), module);
}

Here is the caller graph for this function:

void seat_set_active_display ( Seat seat,
Display display 
)

Definition at line 155 of file seat.c.

{
    g_return_if_fail (seat != NULL);
    SEAT_GET_CLASS (seat)->set_active_display (seat, display);
}

Here is the caller graph for this function:

void seat_set_can_switch ( Seat seat,
gboolean  can_switch 
)

Definition at line 131 of file seat.c.

{
    g_return_if_fail (seat != NULL);

    seat->priv->can_switch = can_switch;
}

Here is the caller graph for this function:

void seat_set_property ( Seat seat,
const gchar *  name,
const gchar *  value 
)

Definition at line 95 of file seat.c.

{
    g_return_if_fail (seat != NULL);
    g_hash_table_insert (seat->priv->properties, g_strdup (name), g_strdup (value));
}

Here is the caller graph for this function:

gboolean seat_start ( Seat seat)

Definition at line 139 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
  
    SEAT_GET_CLASS (seat)->setup (seat);
    return SEAT_GET_CLASS (seat)->start (seat);
}

Here is the caller graph for this function:

void seat_stop ( Seat seat)

Definition at line 564 of file seat.c.

{
    g_return_if_fail (seat != NULL);

    if (seat->priv->stopping)
        return;

    g_debug ("Stopping seat");
    seat->priv->stopping = TRUE;
    SEAT_GET_CLASS (seat)->stop (seat);
}

Here is the caller graph for this function:

gboolean seat_switch_to_greeter ( Seat seat)

Definition at line 512 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);

    if (!seat->priv->can_switch)
        return FALSE;

    g_debug ("Switching to greeter");
    return switch_to_user_or_start_greeter (seat, NULL, TRUE, FALSE, NULL, FALSE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_switch_to_guest ( Seat seat,
const gchar *  session_name 
)

Definition at line 537 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);

    if (!seat->priv->can_switch || !seat_get_allow_guest (seat))
        return FALSE;

    if (seat->priv->guest_username)
        g_debug ("Switching to existing guest account %s", seat->priv->guest_username);
    else
        g_debug ("Switching to new guest account");
    return switch_to_user_or_start_greeter (seat, seat->priv->guest_username, TRUE, TRUE, session_name, FALSE, TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean seat_switch_to_user ( Seat seat,
const gchar *  username,
const gchar *  session_name 
)

Definition at line 524 of file seat.c.

{
    g_return_val_if_fail (seat != NULL, FALSE);
    g_return_val_if_fail (username != NULL, FALSE);

    if (!seat->priv->can_switch)
        return FALSE;

    g_debug ("Switching to user %s", username);
    return switch_to_user_or_start_greeter (seat, username, TRUE, FALSE, session_name, FALSE, FALSE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void session_stopped_cb ( Session session,
Seat seat 
) [static]

Definition at line 368 of file seat.c.

{
    Display *display = NULL;
    GList *link;
    const gchar *script;
  
    /* Work out what display this session is on, it's a bit hacky because we really should know already... */
    for (link = seat->priv->displays; link; link = link->next)
    {
        Display *d = link->data;
        if (display_get_session (d) == session)
        {
            display = d;
            break;
        }
    }
    g_return_if_fail (display != NULL);

    /* Cleanup */
    script = seat_get_string_property (seat, "session-cleanup-script");
    if (script)
        run_script (seat, display, script, session_get_user (session));

    if (seat->priv->guest_username && strcmp (session_get_username (session), seat->priv->guest_username) == 0)
    {
        guest_account_cleanup (seat->priv->guest_username);
        g_free (seat->priv->guest_username);
        seat->priv->guest_username = NULL;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean switch_to_user ( Seat seat,
const gchar *  username,
gboolean  unlock 
) [static]

Definition at line 190 of file seat.c.

{
    GList *link;

    /* Switch to active display if it exists */
    for (link = seat->priv->displays; link; link = link->next)
    {
        Display *display = link->data;

        /* If already logged in, then switch to that display */
        if (g_strcmp0 (display_get_username (display), username) == 0)        
        {
            if (username)
                g_debug ("Switching to existing session for user %s", username);
            else
                g_debug ("Switching to existing greeter");
            if (unlock)
                display_unlock (display);
            seat_set_active_display (seat, display);
            return TRUE;
        }
    }

    return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean switch_to_user_or_start_greeter ( Seat seat,
const gchar *  username,
gboolean  use_existing,
gboolean  is_guest,
const gchar *  session_name,
gboolean  is_lock,
gboolean  autologin 
) [static]

Definition at line 440 of file seat.c.

{
    Display *display;
    DisplayServer *display_server;

    /* Switch to existing if it exists */
    if (use_existing && switch_to_user (seat, username, FALSE))
        return TRUE;

    /* If one don't exist then start a greeter */
    if (autologin)
    {
        if (is_guest)
            g_debug ("Starting new display for automatic guest login");
        else if (username)
            g_debug ("Starting new display for automatic login as user %s", username);
        else
            g_debug ("Starting new display for greeter");
    }
    else
    {
        if (is_guest)
            g_debug ("Starting new display for greeter with guest selected");
        else if (username)
            g_debug ("Starting new display for greeter with user %s selected", username);
        else if (is_lock)
            g_debug ("Starting new display for greeter (lock screen)");
        else
            g_debug ("Starting new display for greeter");
    }

    display_server = SEAT_GET_CLASS (seat)->create_display_server (seat);
    display = display_new (display_server);
    g_object_unref (display_server);

    g_signal_connect (display, "display-server-ready", G_CALLBACK (display_display_server_ready_cb), seat);  
    g_signal_connect (display, "switch-to-user", G_CALLBACK (display_switch_to_user_cb), seat);
    g_signal_connect (display, "switch-to-guest", G_CALLBACK (display_switch_to_guest_cb), seat);
    g_signal_connect (display, "get-guest-username", G_CALLBACK (display_get_guest_username_cb), seat);
    g_signal_connect (display, "create-session", G_CALLBACK (display_create_session_cb), seat);
    g_signal_connect (display, "start-greeter", G_CALLBACK (display_start_greeter_cb), seat);
    g_signal_connect (display, "start-session", G_CALLBACK (display_start_session_cb), seat);
    g_signal_connect_after (display, "start-session", G_CALLBACK (display_session_started_cb), seat);
    g_signal_connect (display, "ready", G_CALLBACK (display_ready_cb), seat);
    g_signal_connect (display, "stopped", G_CALLBACK (display_stopped_cb), seat);
    display_set_greeter_session (display, seat_get_string_property (seat, "greeter-session"));
    display_set_session_wrapper (display, seat_get_string_property (seat, "session-wrapper"));
    display_set_hide_users_hint (display, seat_get_boolean_property (seat, "greeter-hide-users"));
    display_set_show_manual_login_hint (display, seat_get_boolean_property (seat, "greeter-show-manual-login"));
    if (is_lock)
        display_set_lock_hint (display, TRUE);
    display_set_allow_guest (display, seat_get_allow_guest (seat));
    display_set_greeter_allow_guest (display, seat_get_greeter_allow_guest (seat));
    if (autologin)
        display_set_autologin_user (display, username, is_guest, 0);
    else
        display_set_select_user_hint (display, username, is_guest);
    if (!session_name)
        session_name = seat_get_string_property (seat, "user-session");
    display_set_user_session (display, session_name);

    seat->priv->displays = g_list_append (seat->priv->displays, display);
    g_signal_emit (seat, signals[DISPLAY_ADDED], 0, display);

    /* Switch to this display if currently not looking at anything */
    if (!seat->priv->active_display)
        seat_set_active_display (seat, display);

    return display_start (display);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

GHashTable* seat_modules = NULL [static]

Definition at line 58 of file seat.c.

guint signals[LAST_SIGNAL] = { 0 } [static]

Definition at line 25 of file seat.c.