[orca] Ensure we have the live region container before presenting text insertions



commit c16657ee8bbc758be9eb9c52a95c66339066a983
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed May 22 10:37:24 2019 +0200

    Ensure we have the live region container before presenting text insertions

 src/orca/liveregions.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/liveregions.py b/src/orca/liveregions.py
index 4f8917b24..86bb83d31 100644
--- a/src/orca/liveregions.py
+++ b/src/orca/liveregions.py
@@ -403,6 +403,13 @@ class LiveRegionManager:
         attrs = self._getAttrDictionary(obj)
         return 'container-live' in attrs
 
+    def _findContainer(self, obj):
+        isContainer = lambda x: self._getAttrDictionary(x).get('atomic')
+        if isContainer(obj):
+            return obj
+
+        return pyatspi.findAncestor(obj, isContainer)
+
     def _getMessage(self, event):
         """Gets the message associated with a given live event."""
         attrs = self._getAttrDictionary(event.source)
@@ -422,9 +429,8 @@ class LiveRegionManager:
             if attrs.get('container-atomic') != 'true':
                 content = event.any_data
             else:
-                text = self._script.utilities.queryNonEmptyText(event.source)
-                if text:
-                    content = text.getText(0, -1)
+                container = self._findContainer(event.source)
+                content = self._script.utilities.expandEOCs(container)
 
         if not content:
             return None


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