? ariel.install
? gdm2-atspi-main.patch
? gdm2-atspi.patch
? gdmsetup
? daemon/slave-ariel.c
? gui/gdm-atspi-take-one.patch
? gui/gdm-atspi.patch
? gui/gdm2-atspi-main.patch
? gui/pato.patch
Index: gui/gdmcommon.c
===================================================================
RCS file: /cvs/gnome/gdm2/gui/gdmcommon.c,v
retrieving revision 1.26
diff -u -r1.26 gdmcommon.c
--- gui/gdmcommon.c	15 May 2006 18:51:37 -0000	1.26
+++ gui/gdmcommon.c	29 Sep 2006 20:18:18 -0000
@@ -32,6 +32,7 @@
 #include <sys/utsname.h>
 
 #include <glib/gi18n.h>
+#include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
 #include "gdm.h"
@@ -40,6 +41,7 @@
 #include "gdmconfig.h"
 
 gint gdm_timed_delay = 0;
+static Atom AT_SPI_IOR;
 
 /*
  * Some slaves want to send output to syslog and others (such as 
@@ -562,6 +564,104 @@
 		       &error);
 
 	return FALSE;
+}
+
+static gboolean 
+pre_atspi_launch (void){
+	gboolean a11y = gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
+	GPid pid = -1;
+	GError *error = NULL;
+	char *command = NULL;
+	gchar **atspi_prog_argv =  NULL;
+	
+	if (! a11y)
+		return FALSE;
+
+	command = "/usr/libexec/at-spi-registryd";
+
+	atspi_prog_argv = ve_split (command);
+	
+	g_spawn_async (".",
+		       atspi_prog_argv,
+		       NULL,
+		       (GSpawnFlags) (G_SPAWN_SEARCH_PATH),
+		       NULL,
+		       NULL,
+		       &pid,
+		       &error);
+
+	if (kill (pid, 0) < 0) {
+		fprintf (stderr, "at-spi-registryd not running: %s\n", error->message);
+		return FALSE;
+	}
+
+	return TRUE;
+
+}
+
+
+static GdkFilterReturn 
+filter_watch (GdkXEvent *xevent, GdkEvent *event, gpointer data){
+     XEvent *xev = (XEvent *)xevent;
+
+     if (xev->xany.type == PropertyNotify &&
+	 xev->xproperty.atom == AT_SPI_IOR){
+	     gtk_main_quit ();
+	  
+	  return GDK_FILTER_REMOVE;
+     }
+
+     return GDK_FILTER_CONTINUE;
+}
+
+
+static void
+error_dialog (void)
+{
+	GtkWidget *dialog = gtk_message_dialog_new (NULL,
+						    GTK_DIALOG_MODAL,
+						    GTK_MESSAGE_ERROR,
+						    GTK_BUTTONS_OK,
+						    _("Assistive technology support has been requested for this session, butthe accessibility registry was not found.  Please ensure that the AT-SPI package is installed. Your session has been started without assistive technology support."));
+	gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+}
+
+
+
+static gboolean
+filter_timeout (gpointer data)
+{
+	error_dialog ();
+
+	gtk_main_quit ();
+
+	return FALSE;
+}
+
+
+void
+gdm_common_atspi_launch (void)
+{
+	GdkWindow *w = gdk_get_default_root_window (); 
+	guint tid;
+ 
+	if ( ! AT_SPI_IOR)
+		AT_SPI_IOR = XInternAtom (GDK_DISPLAY (), "AT_SPI_IOR", False);
+
+	gdk_window_set_events (w,  GDK_PROPERTY_CHANGE_MASK); 
+	
+	if ( ! pre_atspi_launch ()){
+		error_dialog ();
+		
+		return;
+	}
+	gdk_window_add_filter (w, filter_watch, NULL);
+	tid = g_timeout_add (1e3, filter_timeout, NULL);
+
+	gtk_main ();
+
+	g_source_remove (tid);
 }
 
 void
Index: gui/gdmcommon.h
===================================================================
RCS file: /cvs/gnome/gdm2/gui/gdmcommon.h,v
retrieving revision 1.19
diff -u -r1.19 gdmcommon.h
--- gui/gdmcommon.h	13 Mar 2006 21:18:24 -0000	1.19
+++ gui/gdmcommon.h	29 Sep 2006 20:18:18 -0000
@@ -64,6 +64,7 @@
 void	  gdm_common_setup_background_color (gchar *bg_color);
 gchar*	  gdm_common_get_welcomemsg	    (void);
 void	  gdm_common_pre_fetch_launch       (void);
+void      gdm_common_atspi_launch           (void);
 gchar*    gdm_common_expand_text            (const gchar *text);
 gchar*    gdm_common_get_clock              (struct tm **the_tm);
 
Index: gui/gdmlogin.c
===================================================================
RCS file: /cvs/gnome/gdm2/gui/gdmlogin.c,v
retrieving revision 1.278
diff -u -r1.278 gdmlogin.c
--- gui/gdmlogin.c	31 May 2006 09:24:08 -0000	1.278
+++ gui/gdmlogin.c	29 Sep 2006 20:18:20 -0000
@@ -3171,6 +3171,7 @@
 	gdm_config_get_bool   (GDM_KEY_SYSTEM_MENU);
 	gdm_config_get_bool   (GDM_KEY_TIMED_LOGIN_ENABLE);
         gdm_config_get_bool   (GDM_KEY_TITLE_BAR);
+	gdm_config_get_bool   (GDM_KEY_ADD_GTK_MODULES);
 
 	/* Keys not to include in reread_config */
 	gdm_config_get_bool   (GDM_KEY_LOCK_POSITION);
@@ -3251,7 +3252,8 @@
 	    gdm_config_reload_bool   (GDM_KEY_SHOW_XTERM_FAILSAFE) ||
 	    gdm_config_reload_bool   (GDM_KEY_SYSTEM_MENU) ||
 	    gdm_config_reload_bool   (GDM_KEY_TIMED_LOGIN_ENABLE) ||
-	    gdm_config_reload_bool   (GDM_KEY_TITLE_BAR)) {
+	    gdm_config_reload_bool   (GDM_KEY_TITLE_BAR) ||
+	    gdm_config_reload_bool   (GDM_KEY_ADD_GTK_MODULES)) {
 
 		/* Set busy cursor */
 		gdm_common_setup_cursor (GDK_WATCH);
@@ -3362,6 +3364,14 @@
     bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
     bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
     textdomain (GETTEXT_PACKAGE);
+
+/* gdm_common_atspi_launch () needs gdk initialized.
+ * We cannot start gtk before the registry is running 
+ * because the atk-bridge will crash.
+ */
+
+    gdk_init (&argc, &argv);
+    gdm_common_atspi_launch ();
 
     gtk_init (&argc, &argv);
 
Index: gui/greeter/greeter.c
===================================================================
RCS file: /cvs/gnome/gdm2/gui/greeter/greeter.c,v
retrieving revision 1.125
diff -u -r1.125 greeter.c
--- gui/greeter/greeter.c	9 Jun 2006 21:07:42 -0000	1.125
+++ gui/greeter/greeter.c	29 Sep 2006 20:18:32 -0000
@@ -798,6 +798,7 @@
 	gdm_config_get_bool   (GDM_KEY_SOUND_ON_LOGIN);
 	gdm_config_get_bool   (GDM_KEY_DEFAULT_WELCOME);
 	gdm_config_get_bool   (GDM_KEY_DEFAULT_REMOTE_WELCOME);
+	gdm_config_get_bool   (GDM_KEY_ADD_GTK_MODULES);
 
 	/* Keys not to include in reread_config */
 	gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
@@ -857,7 +858,8 @@
 	    gdm_config_reload_bool   (GDM_KEY_GRAPHICAL_THEME_RAND) ||
 	    gdm_config_reload_bool   (GDM_KEY_SHOW_LAST_SESSION) ||
 	    gdm_config_reload_bool   (GDM_KEY_ALLOW_ROOT) ||
-	    gdm_config_reload_bool   (GDM_KEY_ALLOW_REMOTE_ROOT)) {
+	    gdm_config_reload_bool   (GDM_KEY_ALLOW_REMOTE_ROOT) ||
+	    gdm_config_reload_bool   (GDM_KEY_ADD_GTK_MODULES)) {
 
 		/* Set busy cursor */
 		gdm_common_setup_cursor (GDK_WATCH);
@@ -1034,6 +1036,9 @@
         return TRUE;
 }
 
+
+
+
 int
 main (int argc, char *argv[])
 {
@@ -1067,9 +1072,16 @@
   else
 	   GDM_IS_LOCAL = TRUE;
 
+/* gdm_common_atspi_launch () needs gdk initialized.
+ * We cannot start gtk before the registry is running 
+ * because the atk-bridge will crash.
+ */
+
+  gdk_init (&argc, &argv);
+  gdm_common_atspi_launch ();
+
   gtk_init (&argc, &argv);
 
-  /* Should be a watch already, but anyway */
   gdm_common_setup_cursor (GDK_WATCH);
 
   /* Read all configuration at once, so the values get cached */
@@ -1460,7 +1472,7 @@
   gdm_wm_restore_wm_order ();
 
   gdm_wm_show_info_msg_dialog (gdm_config_get_string (GDM_KEY_INFO_MSG_FILE),
-     gdm_config_get_string (GDM_KEY_INFO_MSG_FONT));
+	gdm_config_get_string (GDM_KEY_INFO_MSG_FONT));
 
   gdm_common_setup_cursor (GDK_LEFT_PTR);
   gdm_common_pre_fetch_launch ();
Index: gui/greeter/greeter_item_ulist.c
===================================================================
RCS file: /cvs/gnome/gdm2/gui/greeter/greeter_item_ulist.c,v
retrieving revision 1.29
diff -u -r1.29 greeter_item_ulist.c
--- gui/greeter/greeter_item_ulist.c	31 May 2006 09:24:08 -0000	1.29
+++ gui/greeter/greeter_item_ulist.c	29 Sep 2006 20:18:33 -0000
@@ -66,6 +66,10 @@
 greeter_item_ulist_unset_selected_user (void)
 {
 	GtkTreeSelection *selection;
+
+	if (user_list == NULL) 
+		return;
+
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (user_list));
 	gtk_tree_selection_unselect_all (selection);
 
