[orca] Try to filter out irrelevant status bar accessible events from Firefox



commit 8602cb3e59cf088b8dbeed2a2bb410b82e8e50ba
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jun 3 14:19:15 2015 -0400

    Try to filter out irrelevant status bar accessible events from Firefox

 src/orca/scripts/toolkits/Gecko/script.py          |   15 +++++++++++++++
 .../scripts/toolkits/Gecko/script_utilities.py     |   10 ++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 2983a13..57ab674 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -1268,6 +1268,11 @@ class Script(default.Script):
     def onNameChanged(self, event):
         """Callback for object:property-change:accessible-name events."""
 
+        if self.utilities.eventIsStatusBarNoise(event):
+            msg = "INFO: Ignoring event believed to be status bar noise"
+            debug.println(debug.LEVEL_INFO, msg)
+            return True
+
         if event.source.getRole() == pyatspi.ROLE_FRAME:
             msg = "INFO: Flusing messages from live region manager"
             debug.println(debug.LEVEL_INFO, msg)
@@ -1289,6 +1294,11 @@ class Script(default.Script):
     def onTextDeleted(self, event):
         """Callback for object:text-changed:delete accessibility events."""
 
+        if self.utilities.eventIsStatusBarNoise(event):
+            msg = "INFO: Ignoring event believed to be status bar noise"
+            debug.println(debug.LEVEL_INFO, msg)
+            return True
+
         if not self.utilities.inDocumentContent(event.source):
             msg = "INFO: Event source is not in document content"
             debug.println(debug.LEVEL_INFO, msg)
@@ -1327,6 +1337,11 @@ class Script(default.Script):
     def onTextInserted(self, event):
         """Callback for object:text-changed:insert accessibility events."""
 
+        if self.utilities.eventIsStatusBarNoise(event):
+            msg = "INFO: Ignoring event believed to be status bar noise"
+            debug.println(debug.LEVEL_INFO, msg)
+            return True
+
         if not self.utilities.inDocumentContent(event.source):
             msg = "INFO: Event source is not in document content"
             debug.println(debug.LEVEL_INFO, msg)
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py 
b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index 448e00c..a8b8f49 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -1584,6 +1584,16 @@ class Utilities(script_utilities.Utilities):
 
         return True
 
+    def eventIsStatusBarNoise(self, event):
+        if self.inDocumentContent(event.source):
+            return False
+
+        eType = event.type
+        if eType.startswith("object:text-") or eType.endswith("accessible-name"):
+            return event.source.getRole() == pyatspi.ROLE_STATUS_BAR
+
+        return False
+
     def eventIsAutocompleteNoise(self, event):
         if not self.inDocumentContent(event.source):
             return False


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