[orca] Listen for the deprecated focus: event for password text in Gtk+ 2 and Gtk+ 3



commit 24c72ad34eef99ebea6d41d176ae563da68eb29a
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Nov 23 19:14:39 2013 -0500

    Listen for the deprecated focus: event for password text in Gtk+ 2 and Gtk+ 3

 src/orca/scripts/toolkits/GAIL/script.py |    5 ++++-
 src/orca/scripts/toolkits/gtk/script.py  |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index c6c4b33..08bc39c 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -47,5 +47,8 @@ class Script(default.Script):
         # Unfiled. But this happens when you are in gtk-demo's application demo,
         # get into a menu and then press Escape. The text widget emits a focus:
         # event, but not a state-changed:focused event.
-        if role == pyatspi.ROLE_TEXT:
+        #
+        # A similar issue can be seen when a text widget starts out having
+        # focus, such as in the old gnome-screensaver dialog.
+        if role in [pyatspi.ROLE_TEXT, pyatspi.ROLE_PASSWORD_TEXT]:
             orca.setLocusOfFocus(event, event.source)
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index fcaa4f6..500da92 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -74,5 +74,8 @@ class Script(default.Script):
         # Unfiled. But this happens when you are in Gedit, get into a menu
         # and then press Escape. The text widget emits a focus: event, but
         # not a state-changed:focused event.
-        if role == pyatspi.ROLE_TEXT:
+        #
+        # A similar issue can be seen when a text widget starts out having
+        # focus, such as in the old gnome-screensaver dialog.
+        if role in [pyatspi.ROLE_TEXT, pyatspi.ROLE_PASSWORD_TEXT]:
             orca.setLocusOfFocus(event, event.source)


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