[orca/gnome-3-20] Also take interfaces into account when looking for non-descendable descendants
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-20] Also take interfaces into account when looking for non-descendable descendants
- Date: Thu, 12 May 2016 16:06:59 +0000 (UTC)
commit cfbc3d70bce51cf7c0bbaf61b09b24678cd0a097
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu May 12 12:04:44 2016 -0400
Also take interfaces into account when looking for non-descendable descendants
src/orca/script_utilities.py | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index a9d7231..ea4d277 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1962,8 +1962,24 @@ class Utilities:
roles = [pyatspi.ROLE_PAGE_TAB_LIST,
pyatspi.ROLE_SPLIT_PANE,
pyatspi.ROLE_TABLE]
- isMatch = lambda x: x and x.getRole() in roles
- return pyatspi.findDescendant(root, isMatch) is not None
+
+ def isMatch(x):
+ if not x:
+ return False
+
+ if x.getRole() in roles:
+ return True
+
+ if 'Table' in pyatspi.listInterfaces(x):
+ return x.childCount > 50
+
+ match = pyatspi.findDescendant(root, isMatch)
+ if match:
+ msg = "INFO: %s has descendant %s" % (root, match)
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return True
+
+ return False
def unrelatedLabels(self, root, onlyShowing=True):
"""Returns a list containing all the unrelated (i.e., have no
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]