Index: shell/ChangeLog
===================================================================
--- shell/ChangeLog	(revision 34389)
+++ shell/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-10-16  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #219197
+
+	* main.c: (gnome_master_client_die_cb), (main):
+	Quit application when session dies.
+
 2007-10-11  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #329823
Index: shell/main.c
===================================================================
--- shell/main.c	(revision 34389)
+++ shell/main.c	(working copy)
@@ -60,6 +60,7 @@
 #include <libgnome/gnome-util.h>
 #include <libgnome/gnome-sound.h>
 #include <libgnomeui/gnome-ui-init.h>
+#include <libgnomeui/gnome-client.h>
 
 #include <bonobo/bonobo-main.h>
 #include <bonobo/bonobo-moniker-util.h>
@@ -451,6 +452,12 @@
 #define setup_segv_redirect() 0
 #endif
 
+static void
+gnome_master_client_die_cb (GnomeClient *client)
+{
+	bonobo_main_quit ();
+}
+
 static const GOptionEntry options[] = {
 	{ "component", 'c', 0, G_OPTION_ARG_STRING, &default_component_id,
 	  N_("Start Evolution activating the specified component"), NULL },
@@ -490,6 +497,7 @@
 	gboolean skip_warning_dialog;
 #endif
 	GnomeProgram *program;
+	GnomeClient *master_client;
 	GOptionContext *context;
 	char *filename;
 
@@ -559,6 +567,10 @@
 			g_warning ("Could not set up debugging output file.");
 	}
 
+	master_client = gnome_master_client ();
+
+	g_signal_connect (G_OBJECT (master_client), "die", G_CALLBACK (gnome_master_client_die_cb), NULL);
+
 	glade_init ();
 	e_cursors_init ();
 	e_icon_factory_init ();
