[orca] Consider alerts as dialogs in 'frameAndDialog'



commit d348621b9e5fa7a43877d67e0c7531c2df1f13a4
Author: Michael Weghorn <m weghorn posteo de>
Date:   Fri Jun 17 15:49:35 2022 +0000

    Consider alerts as dialogs in 'frameAndDialog'

 src/orca/script_utilities.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 1626e1302..ea2ceeee7 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -661,12 +661,15 @@ class Utilities:
         if obj.getRole() == pyatspi.ROLE_FRAME:
             results[0] = obj
 
+        dialog_roles = [pyatspi.ROLE_DIALOG, pyatspi.ROLE_FILE_CHOOSER]
+        if self._treatAlertsAsDialogs():
+            dialog_roles.append(pyatspi.ROLE_ALERT)
+
         parent = obj.parent
         while parent and (parent.parent != parent):
             if parent.getRole() == pyatspi.ROLE_FRAME:
                 results[0] = parent
-            if parent.getRole() in [pyatspi.ROLE_DIALOG,
-                                    pyatspi.ROLE_FILE_CHOOSER]:
+            if parent.getRole() in dialog_roles:
                 results[1] = parent
             parent = parent.parent
 


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