[orca] Work around another instance of app-created duplicate accessible objects
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Work around another instance of app-created duplicate accessible objects
- Date: Wed, 11 May 2016 19:00:03 +0000 (UTC)
commit 648b47f4e931bd413e397bd04047282a6e9a7606
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]