[orca] Don't speak live region messages from inactive tabs



commit fce5fb13e5c9e8cdbb1b00295204c33d62716bf0
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Oct 8 08:41:07 2019 -0400

    Don't speak live region messages from inactive tabs
    
    Note: This can be bypassed by adding the following lines to your
    orca-customizations.py:
    
    import orca.settings
    orca.settings.presentLiveRegionFromInactiveTab = True

 src/orca/scripts/web/script_utilities.py | 6 ++++++
 src/orca/settings.py                     | 1 +
 2 files changed, 7 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index a50832134..27ad8ec9d 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4363,6 +4363,12 @@ class Utilities(script_utilities.Utilities):
         if not self.isLiveRegion(event.source):
             return False
 
+        if not _settingsManager.getSetting('presentLiveRegionFromInactiveTab') \
+           and self.getDocumentForObject(event.source) != self.activeDocument():
+            msg = "WEB: Live region source is not in active tab."
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return False
+
         if event.type.startswith("object:text-changed:insert"):
             isAlert = lambda x: x and x.getRole() == pyatspi.ROLE_ALERT
             alert = pyatspi.findAncestor(event.source, isAlert)
diff --git a/src/orca/settings.py b/src/orca/settings.py
index ccb728ec1..5d8e76358 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -401,3 +401,4 @@ structNavInSayAll = False
 # N.B. The following are experimental and may change or go away at any time.
 enableSadPidginHack = False
 presentChatRoomLast = False
+presentLiveRegionFromInactiveTab = False


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