[orca] Web: Improve behavior when "activating" an element in the nav list



commit bc345a58a5f95eee0a5e68cbfdd3981314c9e066
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon May 2 16:45:21 2022 +0200

    Web: Improve behavior when "activating" an element in the nav list
    
    Orca's navlist was assuming that if an action was present, invoking
    it would actually cause that action to be performed. This does not
    appear to be the case with Chromium's "clickAncestor" action. Therefore,
    if we see that action and/or the action interface exposes 0 actions,
    attempt to synthesize an actual mouse click on the object.

 src/orca/orca_gui_navlist.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/orca_gui_navlist.py b/src/orca/orca_gui_navlist.py
index 176c6903e..7fcd87ed3 100644
--- a/src/orca/orca_gui_navlist.py
+++ b/src/orca/orca_gui_navlist.py
@@ -30,6 +30,7 @@ __license__   = "LGPL"
 from gi.repository import GObject, Gdk, Gtk
 
 from . import debug
+from . import eventsynthesizer
 from . import guilabels
 from . import orca_state
 
@@ -159,11 +160,25 @@ class OrcaNavListGUI:
         except NotImplementedError:
             msg = "ERROR: Action interface not implemented for %s" % obj
             debug.println(debug.LEVEL_INFO, msg, True)
+            return
         except:
             msg = "ERROR: Exception getting action interface for %s" % obj
             debug.println(debug.LEVEL_INFO, msg, True)
-        else:
+            return
+
+        # Chromium exposes the clickAncestor action and then expects us to do the work.
+        # Invoking the action appears to do nothing. Other actions should work as expected.
+        if action.nActions and action.getName(0).lower() != "clickancestor":
             action.doAction(0)
+            return
+
+        if not action.nActions:
+            msg = "INFO: Action interface for %s has 0 actions" % obj
+            debug.println(debug.LEVEL_INFO, msg, True)
+
+        msg = "INFO: Attempting a synthesized click on %s" % obj
+        debug.println(debug.LEVEL_INFO, msg, True)
+        eventsynthesizer.clickObject(obj)
 
     def _getSelectedAccessibleAndOffset(self):
         if not self._tree:


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