Index: pyatspi/registry.py
===================================================================
--- pyatspi/registry.py	(revision 941)
+++ pyatspi/registry.py	(working copy)
@@ -34,10 +34,10 @@
 import Queue
 import traceback
 import ORBit
-import bonobo
 import gobject
 import Accessibility
 import Accessibility__POA
+import gtk
 import utils
 import constants
 import event
@@ -348,7 +348,7 @@
       
     # enter the main loop
     try:
-      bonobo.main()
+      gtk.main()
     finally:
       # clear all observers
       for name, ob in self.observers.items():
@@ -362,7 +362,7 @@
   def stop(self, *args):
     '''Quits the main loop.'''
     try:
-      bonobo.main_quit()
+      gtk.main_quit()
     except RuntimeError:
       # ignore errors when quitting (probably already quitting)
       pass
Index: pyatspi/__init__.py
===================================================================
--- pyatspi/__init__.py	(revision 941)
+++ pyatspi/__init__.py	(working copy)
@@ -33,20 +33,30 @@
 U{http://www.opensource.org/licenses/bsd-license.php}
 '''
 
-REGISTRY_IID = "OAFIID:Accessibility_Registry:1.0"
 TYPELIB_NAME = "Accessibility"
 
+import gobject
+gobject.threads_init()
+
 # import ORBit and bonobo first (required)
 import ORBit, bonobo
 # initialize the ORB
 orb = ORBit.CORBA.ORB_init()
-# get a reference to the gnome Accessibility registry
-reg = bonobo.activation.activate_from_id(REGISTRY_IID, 0, 0)
-if reg is None:
-  raise RuntimeError('could not activate:', REGISTRY_IID)
 # generate Python code for the Accessibility module from the IDL
 ORBit.load_typelib(TYPELIB_NAME)
-
+# get a reference to the GNOME Accessibility registry
+try:
+  import gtk
+  import Accessibility
+  display = gtk.gdk.display_get_default()
+  screen = display.get_default_screen()
+  root = screen.get_root_window()
+  [type, format, at_spi_ior] = root.property_get("AT_SPI_IOR")
+  reg = orb.string_to_object(at_spi_ior)
+  reg = reg._narrow(Accessibility.Registry)
+  del display, screen, root, type, format, at_spi_ior
+except:
+  raise RuntimeError('could not connect to at-api-registryd')
 # import our registry module
 import registry
 # wrap the raw registry object in our convenience singleton
