Skip to content

Commit

Permalink
Respect UIA Notification processing flag (PR #9466)
Browse files Browse the repository at this point in the history
In the Windows 10 may 2019 update, Microsoft decided to announce volume changes using UIA notifications. This means that these volume notifications are announced when the keyboard focus is in Explorer. However, due to the way NVDA handled UIA notifications before this pr, these volume change notifications were queued one after another, resulting into lots of notifications being announced, including duplicates.

Now UIA notifications have a notificationProcessing parameter. When this parameter is set to one of the most recent NotificationProcessing constants, speech is cancelled before announcing the new notification.

Tested with volume changes in Windows 10 1903.
  • Loading branch information
LeonarddeR authored and feerrenrut committed Apr 12, 2019
1 parent b235634 commit a1e59aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/NVDAObjects/UIA/__init__.py
Expand Up @@ -1458,7 +1458,7 @@ def event_UIA_systemAlert(self):
# Ideally, we wouldn't use getBrailleTextForProperties directly. # Ideally, we wouldn't use getBrailleTextForProperties directly.
braille.handler.message(braille.getBrailleTextForProperties(name=self.name, role=self.role)) braille.handler.message(braille.getBrailleTextForProperties(name=self.name, role=self.role))


def event_UIA_notification(self, notificationKind=None, notificationProcessing=None, displayString=None, activityId=None): def event_UIA_notification(self, notificationKind=None, notificationProcessing=UIAHandler.NotificationProcessing_CurrentThenMostRecent, displayString=None, activityId=None):
""" """
Introduced in Windows 10 Fall Creators Update (build 16299). Introduced in Windows 10 Fall Creators Update (build 16299).
This base implementation announces all notifications from the UIA element. This base implementation announces all notifications from the UIA element.
Expand All @@ -1469,6 +1469,10 @@ def event_UIA_notification(self, notificationKind=None, notificationProcessing=N
if self.appModule != api.getFocusObject().appModule: if self.appModule != api.getFocusObject().appModule:
return return
if displayString: if displayString:
if notificationProcessing in (UIAHandler.NotificationProcessing_ImportantMostRecent, UIAHandler.NotificationProcessing_MostRecent):
# These notifications superseed earlier notifications.
# Note that no distinction is made between important and non-important.
speech.cancelSpeech()
ui.message(displayString) ui.message(displayString)


class TreeviewItem(UIA): class TreeviewItem(UIA):
Expand Down

0 comments on commit a1e59aa

Please sign in to comment.