[orca] Reduce chattiness from page tab selection events following focus



commit 87756e1020fa083a93a5ad1aa085bdd87da5c155
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 20 19:00:56 2020 -0400

    Reduce chattiness from page tab selection events following focus
    
    If we get an event from a page tab selection, and if the selected page
    tab has the same name as the currently focused object, there's a healthy
    chance that the page tab selection event came after the focus event. In
    this instance, updating the current focus and presenting the change leads
    to unwanted chattiness.
    
    While this problem and fix resulted from a VSCode issue, this scenario
    could easily happen in other applications. So put the handling in the
    default script.

 src/orca/scripts/default.py | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 705fc7305..3277faa37 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2529,6 +2529,13 @@ class Script(script.Script):
                 debug.println(debug.LEVEL_INFO, msg, True)
                 continue
 
+            if child.getRole() == pyatspi.ROLE_PAGE_TAB and orca_state.locusOfFocus \
+               and child.name == orca_state.locusOfFocus.name \
+               and not state.contains(pyatspi.STATE_FOCUSED):
+                msg = "DEFAULT: %s's selection redundant to %s" % (child, orca_state.locusOfFocus)
+                debug.println(debug.LEVEL_INFO, msg, True)
+                break
+
             if not self.utilities.isLayoutOnly(child):
                 orca.setLocusOfFocus(event, child)
                 break


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