[orca] More work on saving and restoring the Epiphany caret context



commit b90d4f3df529f29212d37405f8b44e104237ce7b
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Feb 1 21:13:39 2014 -0500

    More work on saving and restoring the Epiphany caret context

 src/orca/scripts/apps/epiphany/script.py      |    7 +------
 src/orca/scripts/toolkits/WebKitGtk/script.py |    3 +++
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/scripts/apps/epiphany/script.py b/src/orca/scripts/apps/epiphany/script.py
index 78ec346..fc31f94 100644
--- a/src/orca/scripts/apps/epiphany/script.py
+++ b/src/orca/scripts/apps/epiphany/script.py
@@ -35,7 +35,6 @@ class Script(WebKitGtk.Script):
 
     def __init__(self, app):
         WebKitGtk.Script.__init__(self, app)
-        self._lastCaretContext = None, -1
 
     def onWindowActivated(self, event):
         """Callback for window:activate accessibility events."""
@@ -43,15 +42,11 @@ class Script(WebKitGtk.Script):
         gtk.Script.onWindowActivated(self, event)
 
         obj, offset = self._lastCaretContext
-        if self.utilities.isWebKitGtk(obj):
+        if obj:
             orca.setLocusOfFocus(None, obj)
 
     def onWindowDeactivated(self, event):
         """Callback for window:deactivate accessibility events."""
 
-        obj, offset = self.pointOfReference.get("lastCursorPosition", (None, -1))
-        if self.utilities.isWebKitGtk(obj):
-            self._lastCaretContext = obj, offset
-
         gtk.Script.onWindowDeactivated(self, event)
 
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index b075c1b..347c754 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -71,6 +71,7 @@ class Script(default.Script):
         default.Script.__init__(self, app)
         self._loadingDocumentContent = False
         self._isBrowser = isBrowser
+        self._lastCaretContext = None, -1
 
         self.sayAllOnLoadCheckButton = None
 
@@ -195,6 +196,8 @@ class Script(default.Script):
         - event: the Event
         """
 
+        self._lastCaretContext = event.source, event.detail1
+
         lastKey, mods = self.utilities.lastKeyAndModifiers()
         if lastKey in ['Tab', 'ISO_Left_Tab']:
             return


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