[gdm] daemon: fix autologin
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] daemon: fix autologin
- Date: Tue, 13 Sep 2011 14:42:06 +0000 (UTC)
commit aad28c8bce222e9d5461c3b35dbf5f9eb4a86e82
Author: Ray Strode <rstrode redhat com>
Date: Tue Sep 13 10:26:59 2011 -0400
daemon: fix autologin
In commit 6849f6f3b8a199bed5427b8d6f1e2dedbe035d6c
the code was changed to stop the greeter asynchronously
and start the session following its completion.
Autologin doesn't have a greeter though, so this broke
it.
This commit fixes autologin.
https://bugzilla.gnome.org/show_bug.cgi?id=658899
daemon/gdm-simple-slave.c | 53 +++++++++++++++++++++++++++-----------------
1 files changed, 32 insertions(+), 21 deletions(-)
---
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index 2f38bf6..ab69194 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -108,6 +108,7 @@ G_DEFINE_TYPE (GdmSimpleSlave, gdm_simple_slave, GDM_TYPE_SLAVE)
static void create_new_session (GdmSimpleSlave *slave);
static void destroy_session (GdmSimpleSlave *slave);
static void start_greeter (GdmSimpleSlave *slave);
+static void start_session (GdmSimpleSlave *slave);
static void queue_start_session (GdmSimpleSlave *slave,
const char *service_name);
@@ -449,6 +450,29 @@ stop_greeter (GdmSimpleSlave *slave)
gdm_welcome_session_stop (GDM_WELCOME_SESSION (slave->priv->greeter));
}
+static void
+start_session (GdmSimpleSlave *slave)
+{
+ char *auth_file;
+ auth_file = NULL;
+ add_user_authorization (slave, &auth_file);
+
+ g_assert (auth_file != NULL);
+
+ g_object_set (slave->priv->session,
+ "user-x11-authority-file", auth_file,
+ NULL);
+
+ g_free (auth_file);
+
+ gdm_session_start_session (GDM_SESSION (slave->priv->session),
+ slave->priv->start_session_service_name);
+
+ slave->priv->start_session_id = 0;
+ g_free (slave->priv->start_session_service_name);
+ slave->priv->start_session_service_name = NULL;
+}
+
static gboolean
start_session_timeout (GdmSimpleSlave *slave)
{
@@ -472,8 +496,13 @@ start_session_timeout (GdmSimpleSlave *slave)
g_free (slave->priv->start_session_service_name);
slave->priv->start_session_service_name = NULL;
} else {
- /* Session actually gets started from on_greeter_session_stopped */
- stop_greeter (slave);
+ if (slave->priv->greeter == NULL) {
+ /* auto login */
+ start_session (slave);
+ } else {
+ /* Session actually gets started from on_greeter_session_stop */
+ stop_greeter (slave);
+ }
}
return FALSE;
@@ -972,25 +1001,7 @@ on_greeter_session_stop (GdmGreeterSession *greeter,
gdm_slave_stopped (GDM_SLAVE (slave));
} else {
gdm_greeter_server_stop (slave->priv->greeter_server);
-
- char *auth_file;
- auth_file = NULL;
- add_user_authorization (slave, &auth_file);
-
- g_assert (auth_file != NULL);
-
- g_object_set (slave->priv->session,
- "user-x11-authority-file", auth_file,
- NULL);
-
- g_free (auth_file);
-
- gdm_session_start_session (GDM_SESSION (slave->priv->session),
- slave->priv->start_session_service_name);
-
- slave->priv->start_session_id = 0;
- g_free (slave->priv->start_session_service_name);
- slave->priv->start_session_service_name = NULL;
+ start_session (slave);
}
g_object_unref (slave->priv->greeter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]