[orca/gnome-2-28] Fix for bgo#596384 - Orca sometimes fails to speak a newly-focused table in certain OpenSolaris util



commit 0c03e11a39acdb8c7be2bbc7e48210d3e4aec031
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sat Sep 26 15:09:43 2009 -0400

    Fix for bgo#596384 - Orca sometimes fails to speak a newly-focused table in certain OpenSolaris utilities

 src/orca/default.py                            |   15 ++++++++++++++-
 src/orca/scripts/apps/ddu.py                   |   19 +++++++++++++++++++
 src/orca/scripts/apps/packagemanager/script.py |   18 ++++++++++++++++++
 3 files changed, 51 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/default.py b/src/orca/default.py
index dab8fc8..428b19b 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -3803,6 +3803,18 @@ class Script(script.Script):
         elif settings.enableEchoByWord and self.isWordDelimiter(currentChar):
             self.echoPreviousWord(event.source)
 
+    def stopSpeechOnActiveDescendantChanged(self, event):
+        """Whether or not speech should be stopped prior to setting the
+        locusOfFocus in onActiveDescendantChanged.
+
+        Arguments:
+        - event: the Event
+
+        Returns True if speech should be stopped; False otherwise.
+        """
+
+        return True
+
     def onActiveDescendantChanged(self, event):
         """Called when an object who manages its own descendants detects a
         change in one of its children.
@@ -3820,7 +3832,8 @@ class Script(script.Script):
         #
         child = event.any_data
         if child:
-            speech.stop()
+            if self.stopSpeechOnActiveDescendantChanged(event):
+                speech.stop()
             orca.setLocusOfFocus(event, child)
         else:
             orca.setLocusOfFocus(event, event.source)
diff --git a/src/orca/scripts/apps/ddu.py b/src/orca/scripts/apps/ddu.py
index b791301..cc13985 100644
--- a/src/orca/scripts/apps/ddu.py
+++ b/src/orca/scripts/apps/ddu.py
@@ -28,6 +28,7 @@ __license__   = "LGPL"
 import pyatspi
 
 import orca.default as default
+import orca.orca_state as orca_state
 import orca.speech as speech
 
 ########################################################################
@@ -94,6 +95,24 @@ class Script(default.Script):
 
         return False
 
+    def stopSpeechOnActiveDescendantChanged(self, event):
+        """Whether or not speech should be stopped prior to setting the
+        locusOfFocus in onActiveDescendantChanged.
+
+        Arguments:
+        - event: the Event
+
+        Returns True if speech should be stopped; False otherwise.
+        """
+
+        # Intentionally doing an equality check for performance
+        # purposes.
+        #
+        if event.any_data == orca_state.locusOfFocus:
+            return False
+
+        return True
+
     def getRealActiveDescendant(self, obj):
         """Given an object that should be a child of an object that
         manages its descendants, return the child that is the real
diff --git a/src/orca/scripts/apps/packagemanager/script.py b/src/orca/scripts/apps/packagemanager/script.py
index 85e7e69..8a18550 100644
--- a/src/orca/scripts/apps/packagemanager/script.py
+++ b/src/orca/scripts/apps/packagemanager/script.py
@@ -148,6 +148,24 @@ class Script(default.Script):
 
         return statusBar
 
+    def stopSpeechOnActiveDescendantChanged(self, event):
+        """Whether or not speech should be stopped prior to setting the
+        locusOfFocus in onActiveDescendantChanged.
+
+        Arguments:
+        - event: the Event
+
+        Returns True if speech should be stopped; False otherwise.
+        """
+
+        # Intentionally doing an equality check for performance
+        # purposes.
+        #
+        if event.any_data == orca_state.locusOfFocus:
+            return False
+
+        return True
+
     def isSearchEntry(self, obj):
         """Attempts to distinguish the Search entry from other accessibles.
 



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