[orca] Work around a missing state-changed:focused event in LibreOffice



commit 14f33aef0384a28dd3574d163201f5e365a758e7
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Feb 3 08:59:56 2014 -0500

    Work around a missing state-changed:focused event in LibreOffice

 src/orca/scripts/apps/soffice/script.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index 1eb076c..c550ff2 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -892,6 +892,20 @@ class Script(default.Script):
 
         default.Script.onChildrenChanged(self, event)
 
+    def onFocus(self, event):
+        """Callback for focus: accessibility events."""
+
+        # NOTE: This event type is deprecated and Orca should no longer use it.
+        # This callback remains just to handle bugs in applications and toolkits
+        # during the remainder of the unstable (3.11) development cycle.
+
+        role = event.source.getRole()
+
+        # This seems to be something we inherit from Gtk+
+        if role in [pyatspi.ROLE_TEXT, pyatspi.ROLE_PASSWORD_TEXT]:
+            orca.setLocusOfFocus(event, event.source)
+            return
+
     def onFocusedChanged(self, event):
         """Callback for object:state-changed:focused accessibility events."""
 


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