[orca] If we get a text change from a focused password field, update the locusOfFocus



commit ea877cf8f011213e07fd7750fa010942b43d03f1
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Oct 20 16:48:41 2015 -0400

    If we get a text change from a focused password field, update the locusOfFocus

 src/orca/scripts/default.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index f17d903..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):


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