>From 3181e1d1e77636951b2d73258e4c67e2e8f380fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Vilmar=20Est=C3=A1cio=20de=20Souza?= Date: Wed, 4 Dec 2013 10:36:10 -0200 Subject: [PATCH 1/2] Fix a chattiness in eclipse. The chattiness can be observed in the table present inannotations. Everytime we press down/up arrow, orca reads the number of rows and columns of the table. --- src/orca/scripts/apps/Eclipse/script.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/orca/scripts/apps/Eclipse/script.py b/src/orca/scripts/apps/Eclipse/script.py index 97a8c31..1d866dd 100644 --- a/src/orca/scripts/apps/Eclipse/script.py +++ b/src/orca/scripts/apps/Eclipse/script.py @@ -26,6 +26,7 @@ __copyright__ = "Copyright (c) 2010 Informal Informatica LTDA." __license__ = "LGPL" import orca.scripts.toolkits.GAIL as GAIL +import orca.orca_state as orca_state import pyatspi ######################################################################## @@ -113,4 +114,18 @@ class Script(GAIL.Script): if self.utilities.isTextArea(obj): self._saveLastCursorPosition(obj, obj.queryText().caretOffset) + def onSelectionChanged(self, event): + """Callback for object:selection-changed accessibility events.""" + + obj = event.source + state = obj.getState() + # sometimes eclipse issues an object:selection-changed for objects not focused. + # we do not want that orca announces this objects. + + if not state.contains(pyatspi.STATE_FOCUSED): + # the exception, at least for while, is the MenuBar + if obj.getRole() != pyatspi.ROLE_MENU_BAR: + return + GAIL.Script.onSelectionChanged(self, event) + -- 1.8.4.2