From: padraigo Date: Fri, 15 Nov 2002 09:27:05 +0000 (+0000) Subject: * atk-bridge/bridge.c X-Git-Tag: AT_SPI2_ATK_2_12_0~1314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=857ce28076d7542ec710e1ecc6530ca5968274c4;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git * 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. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@358 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- diff --git a/ChangeLog b/ChangeLog index 9683b6d..4bb63d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-11-15 Padraig O'Briain + + * 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 * registryd/deviceeventcontroller.c diff --git a/atk-bridge/bridge.c b/atk-bridge/bridge.c index 14d672f..21f47e0 100644 --- a/atk-bridge/bridge.c +++ b/atk-bridge/bridge.c @@ -41,8 +41,14 @@ static CORBA_Environment ev; 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); @@ -87,8 +93,6 @@ extern void gnome_accessibility_module_shutdown (void); static int atk_bridge_init (gint *argc, gchar **argv[]) { - CORBA_Environment ev; - if (atk_bridge_initialized) { return 0; @@ -101,13 +105,31 @@ atk_bridge_init (gint *argc, gchar **argv[]) } /* - * 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); @@ -130,7 +152,15 @@ atk_bridge_init (gint *argc, gchar **argv[]) 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