[orca/gnome-3-20] Hack around GNOME Shell's broken text interface for word echo



commit 836bf2edb97c082ef49b9d0f69d2833dfd84ea1d
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 25 17:53:31 2016 -0400

    Hack around GNOME Shell's broken text interface for word echo

 src/orca/scripts/apps/gnome-shell/script.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/gnome-shell/script.py b/src/orca/scripts/apps/gnome-shell/script.py
index 1720148..dbabd9f 100644
--- a/src/orca/scripts/apps/gnome-shell/script.py
+++ b/src/orca/scripts/apps/gnome-shell/script.py
@@ -193,3 +193,20 @@ class Script(clutter.Script):
                     self._activeDialogLabels[hash(label)] = label.name
 
         clutter.Script.onFocusedChanged(self, event)
+
+    def echoPreviousWord(self, obj, offset=None):
+        try:
+            text = obj.queryText()
+        except NotImplementedError:
+            return False
+
+        if not offset:
+            if text.caretOffset == -1:
+                offset = text.characterCount - 1
+            else:
+                offset = text.caretOffset - 1
+
+        if offset == 0:
+            return False
+
+        return super().echoPreviousWord(obj, offset)


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