[orca] Be sure we have an active window and focused object when a key is pressed
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Be sure we have an active window and focused object when a key is pressed
- Date: Tue, 20 Oct 2015 20:35:07 +0000 (UTC)
commit 4d23f948e15dcdc741ee8b8c45b5aca2a4ee7fc3
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Oct 20 16:33:03 2015 -0400
Be sure we have an active window and focused object when a key is pressed
src/orca/orca.py | 2 ++
src/orca/script_utilities.py | 3 +++
src/orca/scripts/default.py | 6 ++++++
3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index f931a45..62acbb7 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -256,6 +256,8 @@ def _processKeyboardEvent(event):
return False
if isPressedEvent:
+ if not orca_state.activeWindow:
+ orca_state.activeWindow = script.utilities.activeWindow()
script.presentationInterrupt()
script.presentKeyboardEvent(keyboardEvent)
if keyboardEvent.isModifierKey() and not isOrcaModifier:
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index afb544c..4ecc981 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -492,6 +492,9 @@ class Utilities:
the FOCUSED state can be found.
"""
+ if not root:
+ return None
+
if root.getState().contains(pyatspi.STATE_FOCUSED):
return root
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 46920ef..f17d903 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -4046,6 +4046,12 @@ class Script(script.Script):
except:
return False
+ if role in [pyatspi.ROLE_DIALOG, pyatspi.ROLE_FRAME, pyatspi.ROLE_WINDOW]:
+ focusedObject = self.utilities.focusedObject(orca_state.activeWindow)
+ if focusedObject:
+ orca.setLocusOfFocus(None, focusedObject, False)
+ role = focusedObject.getRole()
+
if role == pyatspi.ROLE_PASSWORD_TEXT:
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]