[orca] Eliminate chattiness while switching page tabs



commit a061fce325e467b87c399c77e850cdba3e1ebae3
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Apr 19 20:04:39 2019 -0400

    Eliminate chattiness while switching page tabs

 src/orca/scripts/toolkits/Gecko/script_utilities.py | 9 +++++++++
 src/orca/scripts/web/script.py                      | 2 +-
 src/orca/speech_generator.py                        | 3 +++
 3 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py 
b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index 824456290..51e6a8f3f 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -92,6 +92,15 @@ class Utilities(web.Utilities):
                 return int(attr[6:]) - 1
         return -1
 
+    def isLayoutOnly(self, obj):
+        if super().isLayoutOnly(obj):
+            return True
+
+        if obj.getRole() == pyatspi.ROLE_TOOL_BAR and obj.childCount:
+            return obj[0] and obj[0].getRole() == pyatspi.ROLE_PAGE_TAB_LIST
+
+        return False
+
     def isSameObject(self, obj1, obj2, comparePaths=False, ignoreNames=False):
         if super().isSameObject(obj1, obj2, comparePaths, ignoreNames):
             return True
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index b50e35c84..47e461f7f 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1846,7 +1846,7 @@ class Script(default.Script):
             msg = "WEB: Event believed to be chrome page switch"
             debug.println(debug.LEVEL_INFO, msg, True)
             if event.detail1:
-                self.presentObject(event.source)
+                self.presentObject(event.source, priorObj=orca_state.locusOfFocus)
             return True
 
         if not self.utilities.inDocumentContent(event.source):
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index cafe3d16f..737207664 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1795,6 +1795,9 @@ class SpeechGenerator(generator.Generator):
         if not priorObj or obj == priorObj:
             return []
 
+        if obj.getRole() == pyatspi.ROLE_PAGE_TAB:
+            return []
+
         if obj.getApplication() != priorObj.getApplication() \
            or pyatspi.findAncestor(obj, lambda x: x == priorObj):
             return []


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