[at-spi2-atk] Lease objects that send events if they are not cached



commit b5b5b7890a2eced829a60cfd3881f708c6df16e6
Author: Mike Gorse <mgorse novell com>
Date:   Thu Jun 3 14:19:24 2010 -0400

    Lease objects that send events if they are not cached
    
    When sending an event, lease it if it is not in the cache, except for
    children-changed events, which should update the cache.
    This helps prevent errors with Firefox, which can send property-changed
    events on a progress bar that was never otherwise exposed.

 atk-adaptor/event.c  |    3 +++
 atk-adaptor/object.c |    8 ++++----
 atk-adaptor/object.h |    3 +++
 3 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 69de709..3babc2f 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -345,6 +345,9 @@ emit_event (AtkObject  *obj,
 
   dbus_connection_send(bus, sig, NULL);
   dbus_message_unref(sig);
+
+  if (g_strcmp0 (cname, "ChildrenChanged") != 0)
+    spi_object_lease_if_needed (G_OBJECT (obj));
 }
 
 /*---------------------------------------------------------------------------*/
diff --git a/atk-adaptor/object.c b/atk-adaptor/object.c
index 2247467..04e456f 100644
--- a/atk-adaptor/object.c
+++ b/atk-adaptor/object.c
@@ -55,8 +55,8 @@
  * This function will simply look for all the accessibles that the cache object
  * has not found and assume that they need to be leased.
  */
-static void
-maybe_lease (GObject *obj)
+void
+spi_object_lease_if_needed (GObject *obj)
 {
   if (!spi_cache_in (spi_global_cache, obj))
     {
@@ -101,7 +101,7 @@ spi_object_append_reference (DBusMessageIter * iter, AtkObject * obj)
     return;
   }
 
-  maybe_lease (G_OBJECT (obj));
+  spi_object_lease_if_needed (G_OBJECT (obj));
 
   name = dbus_bus_get_unique_name (spi_global_app_data->bus);
   path = spi_register_object_to_path (spi_global_register, G_OBJECT (obj));
@@ -132,7 +132,7 @@ spi_hyperlink_append_reference (DBusMessageIter * iter, AtkHyperlink * obj)
     return;
   }
 
-  maybe_lease (G_OBJECT (obj));
+  spi_object_lease_if_needed (G_OBJECT (obj));
 
   name = dbus_bus_get_unique_name (spi_global_app_data->bus);
   path = spi_register_object_to_path (spi_global_register, G_OBJECT (obj));
diff --git a/atk-adaptor/object.h b/atk-adaptor/object.h
index ac2cbb4..3b27292 100644
--- a/atk-adaptor/object.h
+++ b/atk-adaptor/object.h
@@ -28,6 +28,9 @@
 #include <dbus/dbus.h>
 
 void
+spi_object_lease_if_needed (GObject *obj);
+
+void
 spi_object_append_reference (DBusMessageIter * iter, AtkObject * obj);
 
 void



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