Invalidate states when receiving a focus event
authorMike Gorse <mgorse@novell.com>
Tue, 21 Feb 2012 16:58:02 +0000 (10:58 -0600)
committerMike Gorse <mgorse@novell.com>
Tue, 21 Feb 2012 16:58:02 +0000 (10:58 -0600)
Sometimes we get "focus" events from gtk, but the cache still does not
indicate that the object has STATE_FOCUSED. Really should get to the
bottom of this but don't have time to investigate more right now. Might
be some kind of issue with the accessible being added to the cache
before it is fully initialized--perhaps AddAccessible really doesn't
make sense.

https://bugzilla.gnome.org/show_bug.cgi?id=663992

atspi/atspi-event-listener.c

index 4581f82..753e094 100644 (file)
@@ -935,6 +935,11 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data)
   {
     cache_process_state_changed (&e);
   }
+  else if (!strncmp (e.type, "focus", 5))
+  {
+    /* BGO#663992 - TODO: figure out the real problem */
+    e.source->cached_properties &= ~(ATSPI_CACHE_STATES);
+  }
 
   _atspi_send_event (&e);