[orca] Fix for bgo#622812 - Firefox: Combo boxes cannot be activated via cursor routing keys



commit e5524f8a1169f6e2dbbaa9678f1c50eeac15ad38
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sat Jun 26 23:50:17 2010 -0400

    Fix for bgo#622812 - Firefox: Combo boxes cannot be activated via cursor routing keys

 src/orca/braille.py                                |    7 +++++++
 src/orca/script_utilities.py                       |   14 ++++++++++++++
 .../scripts/toolkits/Gecko/script_utilities.py     |   18 ++++++++++++++++++
 3 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index cf15ee9..56a5763 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -521,6 +521,13 @@ class Component(Region):
         associated with this region.  Note that the zeroeth character may have
         been scrolled off the display."""
 
+        if orca_state.activeScript and orca_state.activeScript.utilities.\
+           grabFocusBeforeRouting(self.accessible, offset):
+            try:
+                self.accessible.queryComponent().grabFocus()
+            except:
+                pass
+
         try:
             action = self.accessible.queryAction()
         except:
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index e6e1cd2..a744434 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -657,6 +657,20 @@ class Utilities:
 
         return results
 
+    def grabFocusBeforeRouting(self, obj, offset):
+        """Whether or not we should perform a grabFocus before routing
+        the cursor via the braille cursor routing keys.
+
+        Arguments:
+        - obj: the accessible object where the cursor should be routed
+        - offset: the offset to which it should be routed
+
+        Returns True if we should do an explicit grabFocus on obj prior
+        to routing the cursor.
+        """
+
+        return False
+
     def hasMatchingHierarchy(self, obj, rolesList):
         """Called to determine if the given object and it's hierarchy of
         parent objects, each have the desired roles. Please note: You
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index 7e872b8..93a8175 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -213,6 +213,24 @@ class Utilities(script_utilities.Utilities):
 
         return None
 
+    def grabFocusBeforeRouting(self, obj, offset):
+        """Whether or not we should perform a grabFocus before routing
+        the cursor via the braille cursor routing keys.
+
+        Arguments:
+        - obj: the accessible object where the cursor should be routed
+        - offset: the offset to which it should be routed
+
+        Returns True if we should do an explicit grabFocus on obj prior
+        to routing the cursor.
+        """
+
+        if obj and obj.getRole() == pyatspi.ROLE_COMBO_BOX \
+           and not self.isSameObject(obj, orca_state.locusOfFocus):
+            return True
+
+        return False
+
     def isEntry(self, obj):
         """Returns True if we should treat this object as an entry."""
 



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