Commit da22a147 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Make sure slaves respond to exit of welcome session.

2008-02-01  William Jon McCann  <mccann@jhu.edu>

	* daemon/gdm-factory-slave.c: (on_greeter_session_start),
	(on_greeter_session_stop), (on_greeter_session_exited),
	(on_greeter_session_died), (run_greeter):
	* daemon/gdm-simple-slave.c: (on_greeter_session_start),
	(on_greeter_session_stop), (on_greeter_session_exited),
	(on_greeter_session_died), (run_greeter):
	* daemon/gdm-welcome-session.c: (stop_dbus_daemon),
	(welcome_session_child_watch), (start_dbus_daemon):
	Make sure slaves respond to exit of welcome session.


svn path=/trunk/; revision=5679
parent 95d1cc7c
2008-02-01 William Jon McCann <mccann@jhu.edu>
* daemon/gdm-factory-slave.c: (on_greeter_session_start),
(on_greeter_session_stop), (on_greeter_session_exited),
(on_greeter_session_died), (run_greeter):
* daemon/gdm-simple-slave.c: (on_greeter_session_start),
(on_greeter_session_stop), (on_greeter_session_exited),
(on_greeter_session_died), (run_greeter):
* daemon/gdm-welcome-session.c: (stop_dbus_daemon),
(welcome_session_child_watch), (start_dbus_daemon):
Make sure slaves respond to exit of welcome session.
2008-02-01 William Jon McCann <mccann@jhu.edu>
* daemon/Makefile.am:
......
......@@ -110,19 +110,38 @@ queue_greeter_reset (GdmFactorySlave *slave)
}
static void
on_greeter_start (GdmGreeterSession *greeter,
GdmFactorySlave *slave)
on_greeter_session_start (GdmGreeterSession *greeter,
GdmFactorySlave *slave)
{
g_debug ("GdmFactorySlave: Greeter started");
}
static void
on_greeter_stop (GdmGreeterSession *greeter,
GdmFactorySlave *slave)
on_greeter_session_stop (GdmGreeterSession *greeter,
GdmFactorySlave *slave)
{
g_debug ("GdmFactorySlave: Greeter stopped");
}
static void
on_greeter_session_exited (GdmGreeterSession *greeter,
int code,
GdmFactorySlave *slave)
{
g_debug ("GdmSimpleSlave: Greeter exited: %d", code);
gdm_slave_stopped (GDM_SLAVE (slave));
}
static void
on_greeter_session_died (GdmGreeterSession *greeter,
int signal,
GdmFactorySlave *slave)
{
g_debug ("GdmSimpleSlave: Greeter died: %d", signal);
gdm_slave_stopped (GDM_SLAVE (slave));
}
static void
on_session_info (GdmSession *session,
const char *text,
......@@ -506,11 +525,19 @@ run_greeter (GdmFactorySlave *slave)
display_is_local);
g_signal_connect (slave->priv->greeter,
"started",
G_CALLBACK (on_greeter_start),
G_CALLBACK (on_greeter_session_start),
slave);
g_signal_connect (slave->priv->greeter,
"stopped",
G_CALLBACK (on_greeter_stop),
G_CALLBACK (on_greeter_session_stop),
slave);
g_signal_connect (slave->priv->greeter,
"exited",
G_CALLBACK (on_greeter_session_exited),
slave);
g_signal_connect (slave->priv->greeter,
"died",
G_CALLBACK (on_greeter_session_died),
slave);
g_object_set (slave->priv->greeter,
"x11-authority-file", auth_file,
......
......@@ -491,17 +491,36 @@ create_new_session (GdmSimpleSlave *slave)
}
static void
on_greeter_start (GdmGreeterSession *greeter,
GdmSimpleSlave *slave)
on_greeter_session_start (GdmGreeterSession *greeter,
GdmSimpleSlave *slave)
{
g_debug ("GdmSimpleSlave: Greeter started");
}
static void
on_greeter_stop (GdmGreeterSession *greeter,
GdmSimpleSlave *slave)
on_greeter_session_stop (GdmGreeterSession *greeter,
GdmSimpleSlave *slave)
{
g_debug ("GdmSimpleSlave: Greeter stopped");
gdm_slave_stopped (GDM_SLAVE (slave));
}
static void
on_greeter_session_exited (GdmGreeterSession *greeter,
int code,
GdmSimpleSlave *slave)
{
g_debug ("GdmSimpleSlave: Greeter exited: %d", code);
gdm_slave_stopped (GDM_SLAVE (slave));
}
static void
on_greeter_session_died (GdmGreeterSession *greeter,
int signal,
GdmSimpleSlave *slave)
{
g_debug ("GdmSimpleSlave: Greeter died: %d", signal);
gdm_slave_stopped (GDM_SLAVE (slave));
}
static void
......@@ -687,11 +706,19 @@ run_greeter (GdmSimpleSlave *slave)
display_is_local);
g_signal_connect (slave->priv->greeter,
"started",
G_CALLBACK (on_greeter_start),
G_CALLBACK (on_greeter_session_start),
slave);
g_signal_connect (slave->priv->greeter,
"stopped",
G_CALLBACK (on_greeter_stop),
G_CALLBACK (on_greeter_session_stop),
slave);
g_signal_connect (slave->priv->greeter,
"exited",
G_CALLBACK (on_greeter_session_exited),
slave);
g_signal_connect (slave->priv->greeter,
"died",
G_CALLBACK (on_greeter_session_died),
slave);
g_object_set (slave->priv->greeter,
"x11-authority-file", auth_file,
......
......@@ -325,6 +325,18 @@ get_welcome_environment (GdmWelcomeSession *welcome_session)
return env;
}
static gboolean
stop_dbus_daemon (GdmWelcomeSession *welcome_session)
{
if (welcome_session->priv->dbus_pid > 0) {
g_debug ("GdmWelcomeSession: Stopping D-Bus daemon");
gdm_signal_pid (-1 * welcome_session->priv->dbus_pid, SIGTERM);
welcome_session->priv->dbus_pid = 0;
}
return TRUE;
}
static void
welcome_session_child_watch (GPid pid,
int status,
......@@ -353,6 +365,7 @@ welcome_session_child_watch (GPid pid,
if (session->priv->ckc != NULL) {
close_welcome_session (session);
}
stop_dbus_daemon (session);
}
typedef struct {
......@@ -615,8 +628,6 @@ start_dbus_daemon (GdmWelcomeSession *welcome_session)
GError *error;
GPtrArray *env;
sleep(10);
g_debug ("GdmWelcomeSession: Starting D-Bus daemon");
env = get_welcome_environment (welcome_session);
......@@ -652,17 +663,6 @@ start_dbus_daemon (GdmWelcomeSession *welcome_session)
return res;
}
static gboolean
stop_dbus_daemon (GdmWelcomeSession *welcome_session)
{
if (welcome_session->priv->dbus_pid > 0) {
g_debug ("GdmWelcomeSession: Stopping D-Bus daemon");
gdm_signal_pid (-1 * welcome_session->priv->dbus_pid, SIGTERM);
welcome_session->priv->dbus_pid = 0;
}
return TRUE;
}
static gboolean
gdm_welcome_session_spawn (GdmWelcomeSession *welcome_session)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment