[orca/gnome-3-20] Work around another instance of app-created duplicate accessible objects



commit 9cb33083ac807f5c33cfd24f2d9b80d6a7631d6d
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed May 11 14:58:01 2016 -0400

    Work around another instance of app-created duplicate accessible objects

 src/orca/speech_generator.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 0ef7bf8..ba6396e 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1501,18 +1501,28 @@ class SpeechGenerator(generator.Generator):
         commonAncestor = self._script.utilities.commonAncestor(priorObj, obj)
         try:
             role = commonAncestor.getRole()
+            name = commonAncestor.name
         except:
-            pass
+            role = None
+            name = None
         else:
             if role == pyatspi.ROLE_COMBO_BOX:
                 return []
 
+        def _isCommonAncestor(x):
+            if not (name and role):
+                return False
+            return x and x.getRole() == role and x.name == name
+
         skipRoles = args.get('skipRoles', [])
         stopAtRoles = args.get('stopAtRoles', [])
         stopAtRoles.append(pyatspi.ROLE_APPLICATION)
         if obj != commonAncestor:
             parent = obj.parent
             while parent and not parent in [commonAncestor, parent.parent]:
+                if _isCommonAncestor(parent):
+                    break
+
                 parentRole = parent.getRole()
                 if parentRole in stopAtRoles:
                     break


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