[orca] Switch to sticky focus mode in top-level web applications
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Switch to sticky focus mode in top-level web applications
- Date: Sat, 17 Oct 2015 06:01:39 +0000 (UTC)
commit 9fcbd4a67eab9d21ecc53fa3bae5255baac9a972
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Sat Oct 17 01:59:34 2015 -0400
Switch to sticky focus mode in top-level web applications
src/orca/scripts/web/script.py | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index fb37ec6..cee5860 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -928,8 +928,8 @@ class Script(default.Script):
self._inMouseOverObject = False
self._lastMouseOverObject = None
- def enableStickyFocusMode(self, inputEvent):
- if not self._focusModeIsSticky:
+ def enableStickyFocusMode(self, inputEvent, forceMessage=False):
+ if not self._focusModeIsSticky or forceMessage:
self.presentMessage(messages.MODE_FOCUS_IS_STICKY)
self._inFocusMode = True
@@ -991,6 +991,11 @@ class Script(default.Script):
speech.speak(self.speechGenerator.generateSpeech(newFocus, priorObj=oldFocus))
self._saveFocusedObjectInfo(newFocus)
+ if self.utilities.inTopLevelWebApp(newFocus):
+ announce = not self.utilities.inDocumentContent(oldFocus)
+ self.enableStickyFocusMode(None, announce)
+ return True
+
if not self._focusModeIsSticky \
and self.useFocusMode(newFocus) != self._inFocusMode:
self.togglePresentationMode(None)
@@ -1056,10 +1061,18 @@ class Script(default.Script):
return True
self.utilities.clearCachedObjects()
- if self.useFocusMode(orca_state.locusOfFocus) != self._inFocusMode:
- self.togglePresentationMode(None)
obj, offset = self.utilities.getCaretContext()
+ if self.utilities.isTopLevelWebApp(event.source):
+ msg = "WEB: Setting locusOfFocus to %s with sticky focus mode" % obj
+ debug.println(debug.LEVEL_INFO, msg)
+ orca.setLocusOfFocus(event, obj)
+ self.enableStickyFocusMode(None, True)
+ return True
+
+ if self.useFocusMode(obj) != self._inFocusMode:
+ self.togglePresentationMode(None)
+
if not obj:
msg = "WEB: Could not get caret context"
debug.println(debug.LEVEL_INFO, msg)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]