Index: gsm-at-startup.c
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/gsm-at-startup.c,v
retrieving revision 1.5
diff -u -r1.5 gsm-at-startup.c
--- gsm-at-startup.c	24 Apr 2006 21:55:25 -0000	1.5
+++ gsm-at-startup.c	18 Jul 2006 21:17:14 -0000
@@ -4,12 +4,17 @@
 #include "gsm-at-startup.h"
 #include "util.h"
 
+#include <gtk/gtk.h>
+#include <gnome.h>
 #include <gdk/gdk.h>
+#include <gdk/gdkx.h>
 #include <libgnome/libgnome.h>
 #include <gconf/gconf-client.h>
 
 #define AT_STARTUP_KEY    "/desktop/gnome/accessibility/startup/exec_ats"
 
+static gboolean gsm_ior_is_present (void);
+
 static void
 gsm_assistive_tech_exec (gchar *exec_string)
 {
@@ -19,6 +24,71 @@
     g_spawn_command_line_async (exec_string, &error);
     g_free (s);
   }
+}
+ 
+
+static GdkFilterReturn 
+filter_watch_ior (GdkXEvent *xevent, 
+		  GdkEvent *event,
+		  gpointer data){
+
+     gboolean *pflag = (gboolean *) data, flag = FALSE;
+
+     if (gsm_ior_is_present ()){
+	  flag = TRUE;
+	  pflag = &flag;
+	  return GDK_FILTER_REMOVE;
+     }
+     return GDK_FILTER_CONTINUE;
+
+}
+
+static void 
+gsm_watch_ior (gboolean flag){
+
+     XSelectInput (GDK_DISPLAY (), GDK_ROOT_WINDOW (), PropertyChangeMask);
+
+     gdk_window_add_filter (gdk_get_default_root_window (),     
+			    filter_watch_ior, (gpointer) &flag);
+      
+}
+
+static gboolean 
+gsm_ior_is_present (){
+  
+     Atom AT_SPI_IOR = XInternAtom (GDK_DISPLAY (), "AT_SPI_IOR", False); 
+     Atom actual_type;
+     int actual_format;
+     unsigned char *ior = NULL;
+     unsigned long nitems;
+     unsigned long leftover;
+
+     XGetWindowProperty (GDK_DISPLAY (), GDK_ROOT_WINDOW (), AT_SPI_IOR, 0L, 
+			 (long) BUFSIZ, False, 
+			 (Atom) 31, &actual_type, &actual_format,
+			 &nitems, &leftover, &ior); 
+     if (ior != NULL){
+	
+	  return TRUE;
+     }
+     return FALSE;
+}
+
+void 
+gsm_assistive_registry_start ()
+{
+
+     gboolean flag = FALSE;
+
+     gsm_watch_ior (flag);
+
+     gsm_assistive_tech_exec ("/usr/libexec/at-spi-registryd");
+     
+     while (!gsm_ior_is_present ())
+	  g_usleep (1);
+
+     return;
+
 }
 
 void 
Index: gsm-at-startup.h
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/gsm-at-startup.h,v
retrieving revision 1.2
diff -u -r1.2 gsm-at-startup.h
--- gsm-at-startup.h	10 Jan 2006 00:48:20 -0000	1.2
+++ gsm-at-startup.h	18 Jul 2006 21:17:14 -0000
@@ -1,6 +1,7 @@
 #ifndef GSM_AT_STARTUP_H
 #define GSM_AT_STARTUP_H
 
+void gsm_assistive_registry_start (void);
 void gsm_assistive_technologies_start (void);
 void gsm_at_set_gtk_modules (void);
 
Index: main.c
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/main.c,v
retrieving revision 1.78
diff -u -r1.78 main.c
--- main.c	24 Apr 2006 21:50:44 -0000	1.78
+++ main.c	18 Jul 2006 21:17:16 -0000
@@ -395,9 +395,11 @@
   gconf_client_add_dir (gconf_client, GSM_GCONF_CONFIG_PREFIX, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); 
   a_t_support = gconf_client_get_bool (gconf_client, ACCESSIBILITY_KEY, NULL);
 
-  if (a_t_support)
+  if (a_t_support){
+    gsm_assistive_registry_start ();
     gsm_at_set_gtk_modules ();
-
+  }
+   
   gnome_program_init("gnome-session", VERSION, LIBGNOMEUI_MODULE, argc, argv, 
 		  GNOME_PARAM_POPT_TABLE, options,
 		  NULL);
