[orca/gnome-3-36] Work around Qt failing to use correct role and/or state



commit 3b734d595d03fa7a3ff210b0000ff6d05b5d372d
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 27 10:45:47 2020 -0400

    Work around Qt failing to use correct role and/or state
    
    Checkable menu items should have STATE_CHECKABLE and/or the role of
    ROLE_CHECK_MENU_ITEM. Apparently this is not always the case for Qt
    apps. This workaround should cause Orca to announce the checked state
    when present, but not announce "not checked." In order for the latter
    to occur, Qt apps should fix the aforementioned bug.

 src/orca/generator.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index 014906aed..91b45e56b 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -681,6 +681,9 @@ class Generator:
            or obj.getRole() == pyatspi.ROLE_CHECK_MENU_ITEM:
             return self._generateCheckedState(obj, **args)
 
+        if obj.getState().contains(pyatspi.STATE_CHECKED):
+            return self._generateCheckedState(obj, **args)
+
         return []
 
     def _generateMenuItemCheckedState(self, obj, **args):


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