[orca] Hack around yet another missing state-changed:focused event from Gtk+



commit 02c58ee79dadcc70f8f699295c35661cd6c475fe
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 26 14:08:29 2014 -0500

    Hack around yet another missing state-changed:focused event from Gtk+

 src/orca/scripts/toolkits/GAIL/script.py |    4 +++-
 src/orca/scripts/toolkits/gtk/script.py  |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index b618dda..c32eeb7 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -80,7 +80,9 @@ class Script(default.Script):
 
         # Unfiled, but in at least some dialogs, the first time a push
         # button gains focus, we only get a focus: event for it.
-        if role == pyatspi.ROLE_PUSH_BUTTON:
+        # Seems to happen for checkboxes too. This is why we can't have
+        # nice things.
+        if role in [pyatspi.ROLE_PUSH_BUTTON, pyatspi.ROLE_CHECK_BOX]:
             orca.setLocusOfFocus(event, event.source)
             return
 
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index b7f78ff..58feb19 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -83,7 +83,9 @@ class Script(default.Script):
             return
 
         # Unfiled, but a similar case of the above issue with combo boxes.
-        if role == pyatspi.ROLE_PUSH_BUTTON:
+        # Seems to happen for checkboxes too. This is why we can't have
+        # nice things.
+        if role in [pyatspi.ROLE_PUSH_BUTTON, pyatspi.ROLE_CHECK_BOX]:
             orca.setLocusOfFocus(event, event.source)
             return
 


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