[orca] Don't speak rolename for status bar notifications
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't speak rolename for status bar notifications
- Date: Sun, 12 Jul 2015 15:10:25 +0000 (UTC)
commit 60febcfa499e80bb09baa0b6104346c2bb75eed4
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Sun Jul 12 17:10:01 2015 +0200
Don't speak rolename for status bar notifications
src/orca/script_utilities.py | 10 ++++++++++
src/orca/speech_generator.py | 3 +++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 16183aa..71b4e85 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -726,6 +726,16 @@ class Utilities:
isStatic = not obj.getState().contains(pyatspi.STATE_FOCUSABLE)
return isStatic
+ def isStatusBarNotification(self, obj):
+ if not (obj and obj.getRole() == pyatspi.ROLE_NOTIFICATION):
+ return False
+
+ isStatusBar = lambda x: x and x.getRole() == pyatspi.ROLE_STATUS_BAR
+ if pyatspi.findAncestor(obj, isStatusBar):
+ return True
+
+ return False
+
def isLayoutOnly(self, obj):
"""Returns True if the given object is a container which has
no presentable information (label, name, displayed text, etc.)."""
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index dbdbef2..a02b484 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -332,6 +332,9 @@ class SpeechGenerator(generator.Generator):
if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
+ if self._script.utilities.isStatusBarNotification(obj):
+ return []
+
result = []
acss = self.voice(SYSTEM)
role = args.get('role', obj.getRole())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]