[orca] Work around AT-SPI2 and ATK having different spacing for the statusbar role name



commit 988706014ec3c6f16d4e8d43a357b38c6a297a28
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Aug 13 18:16:32 2016 -0400

    Work around AT-SPI2 and ATK having different spacing for the statusbar role name

 src/orca/generator.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index 6cd0081..38a38ba 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -1204,6 +1204,15 @@ class Generator:
             if self._script.utilities.isLandmarkForm(obj):
                 role = pyatspi.ROLE_FORM
 
+        if not isinstance(role, (pyatspi.Role, Atspi.Role)):
+            try:
+                return obj.getLocalizedRoleName()
+            except:
+                return ''
+
         nonlocalized = Atspi.role_get_name(role)
         atkRole = Atk.role_for_name(nonlocalized)
+        if atkRole == Atk.Role.INVALID and role == pyatspi.ROLE_STATUS_BAR:
+            atkRole = Atk.role_for_name("statusbar")
+
         return Atk.role_get_localized_name(atkRole)


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