Skip to content
Permalink
Browse files

Respect UIA Notification processing flag (PR #9466)

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 a1e59aa9ccc128062da5150c105fcae66b22cc66
Showing with 5 additions and 1 deletion.
  1. +5 −1 source/NVDAObjects/UIA/__init__.py
@@ -1458,7 +1458,7 @@ def event_UIA_systemAlert(self):
# Ideally, we wouldn't use getBrailleTextForProperties directly.
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).
This base implementation announces all notifications from the UIA element.
@@ -1469,6 +1469,10 @@ def event_UIA_notification(self, notificationKind=None, notificationProcessing=N
if self.appModule != api.getFocusObject().appModule:
return
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)

class TreeviewItem(UIA):

0 comments on commit a1e59aa

Please sign in to comment.
You can’t perform that action at this time.