[orca/gnome-3-34] Don't include alerts from web browsers as unfocused alerts
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-34] Don't include alerts from web browsers as unfocused alerts
- Date: Wed, 13 Nov 2019 18:47:35 +0000 (UTC)
commit ed0777669d738df6d579fb9694d0176c8bf21748
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Nov 13 13:42:29 2019 -0500
Don't include alerts from web browsers as unfocused alerts
The alert role is used for things like Firefox door hangers. They are
almost always unfocused. For this reason, Orca automatically announces
alerts from web browsers even when they are not focused. Also including
these containers in the list of unfocused dialogs is too chatty.
src/orca/script_utilities.py | 8 +++++++-
src/orca/scripts/web/script_utilities.py | 3 +++
2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index aa2a545f1..a04d33f00 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2435,6 +2435,9 @@ class Utilities:
return sorted(labels, key=functools.cmp_to_key(self.spatialComparison))
+ def _treatAlertsAsDialogs(self):
+ return True
+
def unfocusedAlertAndDialogCount(self, obj):
"""If the current application has one or more alert or dialog
windows and the currently focused window is not an alert or a dialog,
@@ -2447,7 +2450,10 @@ class Utilities:
Returns the alert and dialog count.
"""
- roles = [pyatspi.ROLE_ALERT, pyatspi.ROLE_DIALOG]
+ roles = [pyatspi.ROLE_DIALOG]
+ if self._treatAlertsAsDialogs():
+ roles.append(pyatspi.ROLE_ALERT)
+
isDialog = lambda x: x and x.getRole() in roles or self.isFunctionalDialog(x)
dialogs = [x for x in obj.getApplication() if isDialog(x)]
dialogs.extend([x for x in self.topLevelObject(obj) if isDialog(x)])
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index a886b89d5..9d73456c4 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -2031,6 +2031,9 @@ class Utilities(script_utilities.Utilities):
return string, start, end
+ def _treatAlertsAsDialogs(self):
+ return False
+
def treatAsDiv(self, obj, offset=None):
if not (obj and self.inDocumentContent(obj)):
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]