~fboucault/lightdm/crossbuild_fixes

« back to all changes in this revision

Viewing changes to src/display.c

  • Committer: Robert Ancell
  • Date: 2011-06-27 15:51:35 UTC
  • Revision ID: robert.ancell@canonical.com-20110627155135-iz37up9jtfh31i2m
Added guest account support

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "theme.h"
23
23
#include "ldm-marshal.h"
24
24
#include "greeter.h"
 
25
#include "guest-account.h"
25
26
 
26
27
/* Length of time in milliseconds to wait for a session to load */
27
28
#define USER_SESSION_TIMEOUT 5000
467
468
{
468
469
    g_signal_handlers_disconnect_matched (display->priv->user_session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, display);
469
470
 
 
471
    /* If a guest account, remove the account on exit */
 
472
    if (g_strcmp0 (user_get_name (session_get_user (session)), guest_account_get_username (guest_account_get_instance ())) == 0)
 
473
        guest_account_unref (guest_account_get_instance ());
 
474
 
470
475
    g_object_unref (display->priv->user_session);
471
476
    display->priv->user_session = NULL;
472
477
    check_stopped (display);
516
521
static gboolean
517
522
really_start_user_session (Display *display)
518
523
{
 
524
    gboolean result;
 
525
 
519
526
    g_debug ("Starting user session");
520
527
 
521
528
    /* Open ConsoleKit session */
525
532
 
526
533
    g_signal_emit (display, signals[START_SESSION], 0, display->priv->user_session);
527
534
 
528
 
    return session_start (display->priv->user_session, FALSE);
 
535
    result = session_start (display->priv->user_session, FALSE);
 
536
 
 
537
    /* If a guest account, remove the account on exit */
 
538
    if (result && g_strcmp0 (user_get_name (session_get_user (display->priv->user_session)), guest_account_get_username (guest_account_get_instance ())) == 0)
 
539
        guest_account_ref (guest_account_get_instance ());
 
540
 
 
541
    return result;
529
542
}
530
543
 
531
544
static gboolean