[orca] Fix a chattiness in eclipse.



commit 9c6ba78250b682479af245fc1941dc7f8dc2da47
Author: José Vilmar Estácio de Souza <vilmar informal com br>
Date:   Wed Dec 4 10:36:10 2013 -0200

    Fix a chattiness in eclipse.
    
    The chattiness can be observed in the table present inannotations.
    Everytime we press down/up arrow, orca reads the number
    of rows and columns of the table.

 src/orca/scripts/apps/Eclipse/script.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/Eclipse/script.py b/src/orca/scripts/apps/Eclipse/script.py
index 97a8c31..6bf7f62 100644
--- a/src/orca/scripts/apps/Eclipse/script.py
+++ b/src/orca/scripts/apps/Eclipse/script.py
@@ -113,4 +113,17 @@ class Script(GAIL.Script):
         if self.utilities.isTextArea(obj):
             self._saveLastCursorPosition(obj, obj.queryText().caretOffset)
 
+    def onSelectionChanged(self, event):
+        """Callback for object:selection-changed accessibility events."""
+
+        obj = event.source
+        state = obj.getState()
+        # sometimes eclipse issues an object:selection-changed for objects not focused.
+        # we do not want that orca announces this objects.
+
+        if not state.contains(pyatspi.STATE_FOCUSED):
+            # the exception, at least for while, is the MenuBar
+            if obj.getRole() != pyatspi.ROLE_MENU_BAR:
+                return
+        GAIL.Script.onSelectionChanged(self, event)
 


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