[orca/gnome-3-12] Eliminate some extreme chattiness resulting from typeahead search
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-12] Eliminate some extreme chattiness resulting from typeahead search
- Date: Wed, 12 Mar 2014 13:40:26 +0000 (UTC)
commit 68b1655f8be0a3a3f7b72609eefb06c25227d1bf
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Mar 12 09:39:30 2014 -0400
Eliminate some extreme chattiness resulting from typeahead search
src/orca/scripts/toolkits/GAIL/script.py | 21 +++++++++++++++++++--
src/orca/scripts/toolkits/gtk/script.py | 21 +++++++++++++++++++--
2 files changed, 38 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index c32eeb7..771ea47 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -1,6 +1,6 @@
# Orca
#
-# Copyright (C) 2013 Igalia, S.L.
+# Copyright (C) 2013-2014 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs igalia com>
#
@@ -22,7 +22,7 @@
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
-__copyright__ = "Copyright (c) 2013 Igalia, S.L."
+__copyright__ = "Copyright (c) 2013-2014 Igalia, S.L."
__license__ = "LGPL"
import pyatspi
@@ -36,6 +36,23 @@ class Script(default.Script):
def __init__(self, app):
default.Script.__init__(self, app)
+ def onActiveDescendantChanged(self, event):
+ """Callback for object:active-descendant-changed accessibility events."""
+
+ role = event.source.getRole()
+
+ try:
+ focusedRole = orca_state.locusOfFocus.getRole()
+ except:
+ pass
+ else:
+ # This is very likely typeahead search and not a real focus change.
+ tableRoles = [pyatspi.ROLE_TABLE, pyatspi.ROLE_TREE_TABLE]
+ if focusedRole == pyatspi.ROLE_TEXT and role in tableRoles:
+ orca.setLocusOfFocus(event, event.source, False)
+
+ default.Script.onActiveDescendantChanged(self, event)
+
def onFocus(self, event):
"""Callback for focus: accessibility events."""
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 0854391..eaeb256 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -1,6 +1,6 @@
# Orca
#
-# Copyright (C) 2013 Igalia, S.L.
+# Copyright (C) 2013-2014 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs igalia com>
#
@@ -22,7 +22,7 @@
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
-__copyright__ = "Copyright (c) 2013 Igalia, S.L."
+__copyright__ = "Copyright (c) 2013-2014 Igalia, S.L."
__license__ = "LGPL"
import pyatspi
@@ -42,6 +42,23 @@ class Script(default.Script):
def getUtilities(self):
return Utilities(self)
+ def onActiveDescendantChanged(self, event):
+ """Callback for object:active-descendant-changed accessibility events."""
+
+ role = event.source.getRole()
+
+ try:
+ focusedRole = orca_state.locusOfFocus.getRole()
+ except:
+ pass
+ else:
+ # This is very likely typeahead search and not a real focus change.
+ tableRoles = [pyatspi.ROLE_TABLE, pyatspi.ROLE_TREE_TABLE]
+ if focusedRole == pyatspi.ROLE_TEXT and role in tableRoles:
+ orca.setLocusOfFocus(event, event.source, False)
+
+ default.Script.onActiveDescendantChanged(self, event)
+
def onCheckedChanged(self, event):
"""Callback for object:state-changed:checked accessibility events."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]