+2002-11-15 Padraig O'Briain <padraig.obriain@sun.com>
+
+ * atk-bridge/bridge.c
+ (atk_bridge_init): If application is Bonobo component wait until top
+ level is added before registering
+ (spi_atk_bridge_do_registration): New function which contains code,
+ formerly in atk_bridge_init, to do application registration.
+ (spi_atk_bridge_toplevel_added): Signal called when top level
+ added to Bonobo component
+
+ This fixes bug #83134.
+
2002-10-23 Vitaly Tishkov <tvv@sparc.spb.su>
* registryd/deviceeventcontroller.c
static Accessibility_Registry registry = NULL;
static SpiApplication *this_app = NULL;
static gboolean registry_died = FALSE;
+static guint toplevel_handler;
static Accessibility_Registry spi_atk_bridge_get_registry (void);
+static void spi_atk_bridge_do_registration (void);
+static void spi_atk_bridge_toplevel_added (AtkObject *object,
+ guint index,
+ AtkObject *child);
+
static void spi_atk_bridge_exit_func (void);
static void spi_atk_register_event_listeners (void);
static void spi_atk_bridge_focus_tracker (AtkObject *object);
static int
atk_bridge_init (gint *argc, gchar **argv[])
{
- CORBA_Environment ev;
-
if (atk_bridge_initialized)
{
return 0;
}
/*
- * We only want to enable the bridge for top level
+ * We only want to enable the bridge for top level
* applications, we detect bonobo components by seeing
* if they were activated with the intention of extracting
* an impl. by IID - very solid.
*/
if (bonobo_activation_iid_get ())
- return 0;
+ {
+ fprintf (stderr, "Found Bonobo component\n");
+ toplevel_handler = g_signal_connect (atk_get_root (),
+ "children-changed::add",
+ (GCallback) spi_atk_bridge_toplevel_added,
+ NULL);
+ }
+ else
+ {
+ spi_atk_bridge_do_registration ();
+ }
+
+ return 0;
+}
+
+static void
+spi_atk_bridge_do_registration (void)
+{
+ CORBA_Environment ev;
CORBA_exception_init(&ev);
fprintf (stderr, "Application registered & listening\n");
- return 0;
+}
+
+static void
+spi_atk_bridge_toplevel_added (AtkObject *object,
+ guint index,
+ AtkObject *child)
+{
+ g_signal_handler_disconnect (object, toplevel_handler);
+ spi_atk_bridge_do_registration ();
}
static void