[orca] Set windowActivateTime when we have to hack around mate-panel's event ordering
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Set windowActivateTime when we have to hack around mate-panel's event ordering
- Date: Tue, 7 Feb 2017 22:45:32 +0000 (UTC)
commit 5ea234ffcc2791538c002826e17eb1af86eda6a6
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Feb 7 17:43:40 2017 -0500
Set windowActivateTime when we have to hack around mate-panel's event ordering
src/orca/scripts/default.py | 1 +
src/orca/scripts/toolkits/GAIL/script.py | 7 ++++++-
src/orca/scripts/toolkits/gtk/script.py | 7 ++++++-
3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index c07e274..4914938 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -824,6 +824,7 @@ class Script(script.Script):
if not orca_state.activeWindow \
or (event and event.host_application != orca_state.activeScript.app):
orca_state.activeWindow = self.utilities.topLevelObject(newLocusOfFocus)
+ self.windowActivateTime = time.time()
self.updateBraille(newLocusOfFocus)
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index 8fd01c5..3c29c4e 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -26,6 +26,7 @@ __copyright__ = "Copyright (c) 2013-2014 Igalia, S.L."
__license__ = "LGPL"
import pyatspi
+import time
import orca.debug as debug
import orca.orca as orca
@@ -46,7 +47,11 @@ class Script(default.Script):
"""Handles changes of focus of interest to the script."""
if self.utilities.isInOpenMenuBarMenu(newFocus):
- orca_state.activeWindow = self.utilities.topLevelObject(newFocus)
+ window = self.utilities.topLevelObject(newFocus)
+ windowChanged = window and orca_state.activeWindow != window
+ if windowChanged:
+ orca_state.activeWindow = window
+ self.windowActivateTime = time.time()
super().locusOfFocusChanged(event, oldFocus, newFocus)
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 2623132..106b7f2 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -26,6 +26,7 @@ __copyright__ = "Copyright (c) 2013-2014 Igalia, S.L."
__license__ = "LGPL"
import pyatspi
+import time
import orca.debug as debug
import orca.orca as orca
@@ -57,7 +58,11 @@ class Script(default.Script):
newFocus = pyatspi.findAncestor(newFocus, isComboBox) or newFocus
orca.setLocusOfFocus(event, newFocus, False)
elif self.utilities.isInOpenMenuBarMenu(newFocus):
- orca_state.activeWindow = self.utilities.topLevelObject(newFocus)
+ window = self.utilities.topLevelObject(newFocus)
+ windowChanged = window and orca_state.activeWindow != window
+ if windowChanged:
+ orca_state.activeWindow = window
+ self.windowActivateTime = time.time()
super().locusOfFocusChanged(event, oldFocus, newFocus)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]