From 777cdde0f0d68672acfb5e42516adb0873b9d244 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Thu, 7 Feb 2008 02:16:50 +0000 Subject: Make sure we catch the xserver exiting. 2008-02-06 William Jon McCann * daemon/gdm-factory-slave.c: (on_server_ready), (on_server_exited), (on_server_died), (gdm_factory_slave_run): * daemon/gdm-product-slave.c: (on_server_ready), (on_server_exited), (on_server_died), (gdm_product_slave_create_server): * daemon/gdm-server.c: (server_child_watch), (gdm_server_class_init): * daemon/gdm-server.h: * daemon/gdm-simple-slave.c: (on_server_ready), (on_server_exited), (on_server_died), (gdm_simple_slave_run): * daemon/gdm-slave.c: (gdm_slave_connect_to_x11_display): Make sure we catch the xserver exiting. svn path=/trunk/; revision=5711 --- daemon/gdm-server.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'daemon/gdm-server.c') diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c index e973c984..0909e014 100644 --- a/daemon/gdm-server.c +++ b/daemon/gdm-server.c @@ -100,6 +100,8 @@ enum { enum { READY, + EXITED, + DIED, LAST_SIGNAL }; @@ -575,6 +577,14 @@ server_child_watch (GPid pid, : WIFSIGNALED (status) ? WTERMSIG (status) : -1); + if (WIFEXITED (status)) { + int code = WEXITSTATUS (status); + g_signal_emit (server, signals [EXITED], 0, code); + } else if (WIFSIGNALED (status)) { + int num = WTERMSIG (status); + g_signal_emit (server, signals [DIED], 0, num); + } + g_spawn_close_pid (server->priv->pid); server->priv->pid = -1; } @@ -853,6 +863,28 @@ gdm_server_class_init (GdmServerClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals [EXITED] = + g_signal_new ("exited", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GdmServerClass, exited), + NULL, + NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, + G_TYPE_INT); + signals [DIED] = + g_signal_new ("died", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GdmServerClass, died), + NULL, + NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, + G_TYPE_INT); g_object_class_install_property (object_class, PROP_DISPLAY_NAME, -- cgit v1.2.1