[orca] Web: More aggressively update focus for focused entries and spinners
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Web: More aggressively update focus for focused entries and spinners
- Date: Fri, 4 Feb 2022 15:48:15 +0000 (UTC)
commit 771575fdfb5872a721caa8ff5e1e5308cbb77087
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Feb 4 16:42:46 2022 +0100
Web: More aggressively update focus for focused entries and spinners
Typically we get focus events prior to caret moved events for focused
entries and spinners. Except for when we don't. When we silently update
our location in cases where we don't, we are in danger of failing to
present a newly-focused entry. We're seeing this in VSCode. Therefore
move the handling which we were doing in response to pressing the Tab
key to the end of onCaretMoved(). If we get to the end and no other
case has addressed the situation, handle the location change by
presenting it.
src/orca/scripts/web/script.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index fc24e232d..0a50c4b12 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1656,13 +1656,6 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg, True)
return True
- if event.source.getRole() in [pyatspi.ROLE_ENTRY, pyatspi.ROLE_SPIN_BUTTON] \
- and event.source.getState().contains(pyatspi.STATE_FOCUSED) \
- and event.source != orca_state.locusOfFocus:
- msg = "WEB: Event ignored: Entry is not (yet) the locus of focus. Waiting for focus event."
- debug.println(debug.LEVEL_INFO, msg, True)
- return True
-
if self.utilities.inFindContainer():
msg = "WEB: Event handled: Presenting find results"
debug.println(debug.LEVEL_INFO, msg, True)
@@ -1727,6 +1720,13 @@ class Script(default.Script):
msg = "WEB: Caret moved due to native caret navigation."
debug.println(debug.LEVEL_INFO, msg, True)
+ elif event.source.getRole() in [pyatspi.ROLE_ENTRY, pyatspi.ROLE_SPIN_BUTTON] \
+ and event.source.getState().contains(pyatspi.STATE_FOCUSED) \
+ and event.source != orca_state.locusOfFocus:
+ msg = "WEB: Focused entry is not (yet) the locus of focus."
+ debug.println(debug.LEVEL_INFO, msg, True)
+ notify = force = handled = True
+
msg = "WEB: Setting context and focus to: %s, %i" % (obj, offset)
debug.println(debug.LEVEL_INFO, msg, True)
self.utilities.setCaretContext(obj, offset, document)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]