[orca] Don't just grab focus on elements in structural navigation
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't just grab focus on elements in structural navigation
- Date: Mon, 15 Sep 2014 00:07:45 +0000 (UTC)
commit f79df2d5fabe1f390944e4f3a7a122f91ee5f82f
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Sun Sep 14 20:05:21 2014 -0400
Don't just grab focus on elements in structural navigation
Expliciting setting the caret position ensures we keep accurate track of
what has focus.
src/orca/scripts/toolkits/Gecko/script.py | 3 ++-
src/orca/structural_navigation.py | 24 ++++++++++++++++++------
2 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index ebc2df4..642f1c1 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -1234,7 +1234,8 @@ class Script(default.Script):
if self._lastCommandWasStructNav:
msg = "INFO: Focus change event handled manually: last command was struct nav"
debug.println(debug.LEVEL_INFO, msg)
- if role != pyatspi.ROLE_LINK:
+ if role != pyatspi.ROLE_LINK \
+ and obj.parent.getRole() != pyatspi.ROLE_LIST_BOX:
self.setCaretContext(event.source, 0)
orca.setLocusOfFocus(event, event.source)
return
diff --git a/src/orca/structural_navigation.py b/src/orca/structural_navigation.py
index 54d3874..d3bb2eb 100644
--- a/src/orca/structural_navigation.py
+++ b/src/orca/structural_navigation.py
@@ -1916,7 +1916,9 @@ class StructuralNavigation:
"""
if obj:
- obj.queryComponent().grabFocus()
+ [obj, characterOffset] = self._getCaretPosition(obj)
+ self._setCaretPosition(obj, characterOffset)
+ self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_BUTTONS
brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
@@ -1998,7 +2000,9 @@ class StructuralNavigation:
"""
if obj:
- obj.queryComponent().grabFocus()
+ [obj, characterOffset] = self._getCaretPosition(obj)
+ self._setCaretPosition(obj, characterOffset)
+ self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_CHECK_BOXES
brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
@@ -2171,7 +2175,9 @@ class StructuralNavigation:
"""
if obj:
- obj.queryComponent().grabFocus()
+ [obj, characterOffset] = self._getCaretPosition(obj)
+ self._setCaretPosition(obj, characterOffset)
+ self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_COMBO_BOXES
brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
@@ -2266,7 +2272,9 @@ class StructuralNavigation:
"""
if obj:
- obj.queryComponent().grabFocus()
+ [obj, characterOffset] = self._getCaretPosition(obj)
+ self._setCaretPosition(obj, characterOffset)
+ self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_ENTRIES
brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
@@ -2356,7 +2364,9 @@ class StructuralNavigation:
if obj:
if obj.getRole() == pyatspi.ROLE_TEXT and obj.childCount:
obj = obj[0]
- obj.queryComponent().grabFocus()
+ [obj, characterOffset] = self._getCaretPosition(obj)
+ self._setCaretPosition(obj, characterOffset)
+ self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_FORM_FIELDS
brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
@@ -3096,7 +3106,9 @@ class StructuralNavigation:
"""
if obj:
- obj.queryComponent().grabFocus()
+ [obj, characterOffset] = self._getCaretPosition(obj)
+ self._setCaretPosition(obj, characterOffset)
+ self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_RADIO_BUTTONS
brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]