orca r3616 - in trunk: . src/orca



Author: joanied
Date: Wed Feb 20 23:49:16 2008
New Revision: 3616
URL: http://svn.gnome.org/viewvc/orca?rev=3616&view=rev

Log:
* src/orca/Gecko.py: 
  Fix for bug #508163 - Orca tends to be slow in the vicinity
  of combo boxes in Firefox.


Modified:
   trunk/ChangeLog
   trunk/src/orca/Gecko.py

Modified: trunk/src/orca/Gecko.py
==============================================================================
--- trunk/src/orca/Gecko.py	(original)
+++ trunk/src/orca/Gecko.py	Wed Feb 20 23:49:16 2008
@@ -415,10 +415,22 @@
                 menu = child
                 break
         if menu:
-            for child in menu:
-                if child.getState().contains(pyatspi.STATE_SELECTED):
-                    regions.append(braille.Region(child.name))
-                    break
+            child = None
+            try:
+                # This should work...
+                #
+                child = menu.querySelection().getSelectedChild(0)
+            except:
+                # But just in case, we'll fall back on this.
+                # [[[TODO - JD: Will we ever have a case where the first
+                # fails, but this will succeed???]]]
+                #
+                for item in menu:
+                    if item.getState().contains(pyatspi.STATE_SELECTED):
+                        child = item
+                        break
+            if child:
+                regions.append(braille.Region(child.name))
 
         if settings.brailleVerbosityLevel == settings.VERBOSITY_LEVEL_VERBOSE:
             regions.append(braille.Region(
@@ -787,10 +799,22 @@
                 menu = child
                 break
         if menu:
-            for child in menu:
-                if child.getState().contains(pyatspi.STATE_SELECTED):
-                    utterances.append(child.name)
-                    break
+            child = None
+            try:
+                # This should work...
+                #
+                child = menu.querySelection().getSelectedChild(0)
+            except:
+                # But just in case, we'll fall back on this.
+                # [[[TODO - JD: Will we ever have a case where the first
+                # fails, but this will succeed???]]]
+                #
+                for item in menu:
+                    if item.getState().contains(pyatspi.STATE_SELECTED):
+                        child = item
+                        break
+            if child:
+                utterances.append(child.name)
 
         utterances.extend(self._getSpeechForObjectAvailability(obj))
 



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