summaryrefslogtreecommitdiff
path: root/liblightdm-gobject/greeter.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2011-07-18 14:46:43 +1000
committerRobert Ancell <robert.ancell@canonical.com>2011-07-18 14:46:43 +1000
commitf3a094ab39e524644a1a9bc62331959db2527850 (patch)
tree90ba3e794a8076285f0bc08d9f05a99a7efdb157 /liblightdm-gobject/greeter.c
parent3c6bc895de30ae7e0bb6131fe86d568f9c77d799 (diff)
downloadlightdm-f3a094ab39e524644a1a9bc62331959db2527850.tar.gz
Added a session-failed signal to indicate if the session didn't start and the greeter should try authorizing again
Diffstat (limited to 'liblightdm-gobject/greeter.c')
-rw-r--r--liblightdm-gobject/greeter.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/liblightdm-gobject/greeter.c b/liblightdm-gobject/greeter.c
index dabf7bd1..3eee8813 100644
--- a/liblightdm-gobject/greeter.c
+++ b/liblightdm-gobject/greeter.c
@@ -49,6 +49,7 @@ enum {
SHOW_PROMPT,
SHOW_MESSAGE,
AUTHENTICATION_COMPLETE,
+ SESSION_FAILED,
TIMED_LOGIN,
USER_ADDED,
USER_CHANGED,
@@ -342,6 +343,13 @@ handle_end_authentication (LdmGreeter *greeter, gsize *offset)
}
static void
+handle_session_failed (LdmGreeter *greeter, gsize *offset)
+{
+ g_debug ("Session failed to start");
+ g_signal_emit (G_OBJECT (greeter), signals[SESSION_FAILED], 0);
+}
+
+static void
handle_quit (LdmGreeter *greeter, gsize *offset)
{
g_debug ("Got quit request from server");
@@ -420,6 +428,9 @@ from_server_cb (GIOChannel *source, GIOCondition condition, gpointer data)
case GREETER_MESSAGE_END_AUTHENTICATION:
handle_end_authentication (greeter, &offset);
break;
+ case GREETER_MESSAGE_SESSION_FAILED:
+ handle_session_failed (greeter, &offset);
+ break;
case GREETER_MESSAGE_QUIT:
handle_quit (greeter, &offset);
break;
@@ -1862,6 +1873,22 @@ ldm_greeter_class_init (LdmGreeterClass *klass)
G_TYPE_NONE, 0);
/**
+ * LdmGreeter::session-failed:
+ * @greeter: A #LdmGreeter
+ *
+ * The ::session-failed signal gets emitted when the deamon has failed
+ * to start the requested session.
+ **/
+ signals[SESSION_FAILED] =
+ g_signal_new ("session-failed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (LdmGreeterClass, session_failed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
* LdmGreeter::timed-login:
* @greeter: A #LdmGreeter
* @username: A username