Bug#800602: Lightdm: orca speaks characters while typing the password.
Control: tags -1 + patch
Joanmarie Diggs, le Tue 20 Oct 2015 16:58:06 -0400, a écrit :
> On 10/20/2015 01:07 PM, Samuel Thibault wrote:
> > Upstream agrees with the issue and solution, and will look for a more
> > generic way (instead of copying the script over), but we can probably
> > apply the patch to Debian in the meanwhile?
>
> I've just pushed a change to Orca master, two really. It would be great
> if you could test to see if it resolves your problem. I wouldn't mind
> deleting the gdmlogin script either.... :)
Here is the upstream patch.
Samuel
diff --git a/src/orca/orca.py b/src/orca/orca.py
index f931a45..62acbb7 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -256,6 +256,8 @@ def _processKeyboardEvent(event):
return False
if isPressedEvent:
+ if not orca_state.activeWindow:
+ orca_state.activeWindow = script.utilities.activeWindow()
script.presentationInterrupt()
script.presentKeyboardEvent(keyboardEvent)
if keyboardEvent.isModifierKey() and not isOrcaModifier:
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index afb544c..4ecc981 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -492,6 +492,9 @@ class Utilities:
the FOCUSED state can be found.
"""
+ if not root:
+ return None
+
if root.getState().contains(pyatspi.STATE_FOCUSED):
return root
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 46920ef..0f5bfc0 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2472,6 +2472,11 @@ class Script(script.Script):
- event: the Event
"""
+ role = event.source.getRole()
+ state = event.source.getState()
+ if role == pyatspi.ROLE_PASSWORD_TEXT and state.contains(pyatspi.STATE_FOCUSED):
+ orca.setLocusOfFocus(event, event.source, False)
+
# Ignore text deletions from non-focused objects, unless the
# currently focused object is the parent of the object from which
# text was deleted
@@ -2483,7 +2488,7 @@ class Script(script.Script):
# We'll also ignore sliders because we get their output via
# their values changing.
#
- if event.source.getRole() == pyatspi.ROLE_SLIDER:
+ if role == pyatspi.ROLE_SLIDER:
return
# [[[NOTE: WDW - if we handle events synchronously, we'll
@@ -2551,6 +2556,11 @@ class Script(script.Script):
- event: the Event
"""
+ role = event.source.getRole()
+ state = event.source.getState()
+ if role == pyatspi.ROLE_PASSWORD_TEXT and state.contains(pyatspi.STATE_FOCUSED):
+ orca.setLocusOfFocus(event, event.source, False)
+
# Ignore text insertions from non-focused objects, unless the
# currently focused object is the parent of the object from which
# text was inserted.
@@ -2564,11 +2574,9 @@ class Script(script.Script):
pyatspi.ROLE_MENU_ITEM,
pyatspi.ROLE_SLIDER,
pyatspi.ROLE_SPIN_BUTTON]
- role = event.source.getRole()
if role in ignoreRoles:
return
- state = event.source.getState()
if role == pyatspi.ROLE_TABLE_CELL \
and not state.contains(pyatspi.STATE_FOCUSED) \
and not state.contains(pyatspi.STATE_SELECTED):
@@ -4046,6 +4054,12 @@ class Script(script.Script):
except:
return False
+ if role in [pyatspi.ROLE_DIALOG, pyatspi.ROLE_FRAME, pyatspi.ROLE_WINDOW]:
+ focusedObject = self.utilities.focusedObject(orca_state.activeWindow)
+ if focusedObject:
+ orca.setLocusOfFocus(None, focusedObject, False)
+ role = focusedObject.getRole()
+
if role == pyatspi.ROLE_PASSWORD_TEXT:
return False
Reply to: