[orca] Handle yet another case of missing state-changed:focused events



commit 35c510829b96413b2a8ba613e6118af3914d0885
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Nov 24 11:38:26 2013 -0500

    Handle yet another case of missing state-changed:focused events

 src/orca/scripts/toolkits/GAIL/script.py |    5 +++++
 src/orca/scripts/toolkits/gtk/script.py  |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index 722c4d2..1ad7e92 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -59,3 +59,8 @@ class Script(default.Script):
         # event for the menu.
         if role == pyatspi.ROLE_MENU_ITEM:
             orca.setLocusOfFocus(event, event.source)
+
+        # 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:
+            orca.setLocusOfFocus(event, event.source)
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 779dbcb..31598b1 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -71,6 +71,10 @@ class Script(default.Script):
         if role == pyatspi.ROLE_COMBO_BOX:
             orca.setLocusOfFocus(event, event.source)
 
+        # Unfiled, but a similar case of the above issue with combo boxes.
+        if role == pyatspi.ROLE_PUSH_BUTTON:
+            orca.setLocusOfFocus(event, event.source)
+
         # Unfiled. But this happens when you are in Gedit, get into a menu
         # and then press Escape. The text widget emits a focus: event, but
         # not a state-changed:focused event.


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