[orca] Handle WebKitGtk's change in toolkit name casing



commit 1c46e345884b80af5212ed0e091c3b07a18d54d7
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue May 17 12:21:11 2022 +0200

    Handle WebKitGtk's change in toolkit name casing
    
    WebKitGtk objects now expose the toolkit name as WebKitGTK. Our
    script mapping for toolkits should probably not be case sensitive.
    For the purpose of making newer releases of WebKitGtk still work
    with older, stable versions of Orca, this commit just handles
    the alternative casing for WebKitGtk.
    
    Note that in some cases (e.g. Yelp), native caret navigation via
    F7 does not seem to be reliably toggled. That is a feature of either
    the app or the toolkit; not of Orca. This commit does not impact that.
    
    See issue #244

 src/orca/script_manager.py                              | 3 +++
 src/orca/scripts/toolkits/WebKitGtk/script_utilities.py | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_manager.py b/src/orca/script_manager.py
index a3fb55b50..b504618d5 100644
--- a/src/orca/script_manager.py
+++ b/src/orca/script_manager.py
@@ -58,6 +58,8 @@ class ScriptManager:
              'metacity': 'switcher',
              'pluma': 'gedit',
             }
+        self._toolkitNames = \
+            {'WebKitGTK': 'WebKitGtk'}
 
         self.setActiveScript(None, "__init__")
         self._desktop = pyatspi.Registry.getDesktop(0)
@@ -134,6 +136,7 @@ class ScriptManager:
             else:
                 attrs = dict([attr.split(':', 1) for attr in attributes])
                 name = attrs.get('toolkit', '')
+                name = self._toolkitNames.get(name, name)
 
         return name
 
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py 
b/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py
index 15b64939c..604f74917 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script_utilities.py
@@ -58,7 +58,7 @@ class Utilities(script_utilities.Utilities):
             return False
 
         attrs = self.objectAttributes(obj)
-        return attrs.get('toolkit', '') == 'WebKitGtk'
+        return attrs.get('toolkit', '') in ['WebKitGtk', 'WebKitGTK']
 
     def getCaretContext(self):
         # TODO - JD: This is private, but it's only here temporarily until we


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