[orca] Don't look for unrelated labels in gnome-shell if not in a dialog



commit 85fb078cce979a0963cbaea9dde61afcb1e0d612
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Jul 7 09:56:48 2018 -0400

    Don't look for unrelated labels in gnome-shell if not in a dialog

 src/orca/scripts/apps/gnome-shell/script_utilities.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/orca/scripts/apps/gnome-shell/script_utilities.py 
b/src/orca/scripts/apps/gnome-shell/script_utilities.py
index 90a567de0..052d86894 100644
--- a/src/orca/scripts/apps/gnome-shell/script_utilities.py
+++ b/src/orca/scripts/apps/gnome-shell/script_utilities.py
@@ -91,3 +91,15 @@ class Utilities(script_utilities.Utilities):
             debug.println(debug.LEVEL_INFO, msg, True)
 
         return string, start, end
+
+    def unrelatedLabels(self, root, onlyShowing=True, minimumWords=3):
+        if not root:
+            return []
+
+        isDialog = lambda x: x and x.getRole() == pyatspi.ROLE_DIALOG
+        if not isDialog(root) and pyatspi.findAncestor(root, isDialog) is None:
+            msg = "GNOME SHELL: Not seeking unrelated labels for non-dialog"
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return []
+
+        return super().unrelatedLabels(root, onlyShowing, minimumWords)


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