[at-spi2-core/gnome-3-2] Fix for BGO#663992: set STATE_FOCUSED for a "focus" event



commit a0af0bcb79087fc16328cfe69a6845040d504bd1
Author: Mike Gorse <mgorse novell com>
Date:   Mon Nov 14 17:14:21 2011 -0600

    Fix for BGO#663992: set STATE_FOCUSED for a "focus" event
    
    Sometimes gtk does not initially emit a state-change event when an
    accessible initially gains focus, so assume that, if it sends a "focus"
    event, then it is gaining STATE_FOCUSED.
    
    AT-SPI doesn't seem like the right place for this kind of check, but,
    for the sake of getting something working in time for the release, I'm
    committing the change but only in gnome-3-2.

 atspi/atspi-event-listener.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c
index e02a12d..c07fa19 100644
--- a/atspi/atspi-event-listener.c
+++ b/atspi/atspi-event-listener.c
@@ -897,6 +897,9 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data)
   {
     cache_process_state_changed (&e);
   }
+  /* see BGO#663992 */
+  else if (!strncmp (e.type, "focus", 5) && e.source->states)
+    e.source->states->states |= (1 << ATSPI_STATE_FOCUSED);
 
   _atspi_send_event (&e);
 



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