[g-a-devel]Patch for bug 83134



Bug 83134 complains that the CD Track Editor does not appear in at-poke.

The attached patch attempts to fix the problem

Comments, permission to apply requested.

Padraig
cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/at-spi/ChangeLog,v
retrieving revision 1.254
diff -u -p -r1.254 ChangeLog
--- ChangeLog	23 Oct 2002 15:57:39 -0000	1.254
+++ ChangeLog	14 Nov 2002 10:34:49 -0000
@@ -1,3 +1,15 @@
+2002-11-14  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 addresses bug #83134.
+
 2002-10-23  Vitaly Tishkov  <tvv sparc spb su>
 
 	* registryd/deviceeventcontroller.c
Index: atk-bridge/bridge.c
===================================================================
RCS file: /cvs/gnome/at-spi/atk-bridge/bridge.c,v
retrieving revision 1.46
diff -u -p -r1.46 bridge.c
--- atk-bridge/bridge.c	13 Sep 2002 13:08:57 -0000	1.46
+++ atk-bridge/bridge.c	14 Nov 2002 10:34:49 -0000
@@ -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_s
 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 **arg
     }
 
   /*
-   *   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 **arg
 
   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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]