[orca] Also take interfaces into account when looking for non-descendable descendants



commit 8b167a7500b679b637d4c645843c9cfb38f59064
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 6f4ec66..1521e69 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]