From 5aa6dbf96c0a496d1f1a1fb8f9c0aec083133bcd Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Wed, 19 Jan 2022 19:52:17 -0500 Subject: [PATCH] Block console UIA notifications for SV2M2 --- source/NVDAObjects/UIA/winConsoleUIA.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/source/NVDAObjects/UIA/winConsoleUIA.py b/source/NVDAObjects/UIA/winConsoleUIA.py index 267f11abfe9..1f956bc7c2b 100644 --- a/source/NVDAObjects/UIA/winConsoleUIA.py +++ b/source/NVDAObjects/UIA/winConsoleUIA.py @@ -400,6 +400,17 @@ def detectPossibleSelectionChange(self): "probably due to a switch to/from the alt buffer." ), exc_info=True) + def event_UIA_notification(self, **kwargs): + """ + In Windows Sun Valley 2 (SV2 M2), UIA notification events will be sent + to announce new text. Block these for now to avoid double-reporting of + text changes. + @note: In the longer term, NVDA should leverage these events in place + of the current LiveText strategy, as performance will likely be + significantly improved and #11002 can be completely mitigated. + """ + log.debugWarning(f"Notification event blocked to avoid double-report: {kwargs}") + def findExtraOverlayClasses(obj, clsList): if obj.UIAElement.cachedAutomationId == "Text Area": @@ -409,4 +420,13 @@ def findExtraOverlayClasses(obj, clsList): class WinTerminalUIA(EnhancedTermTypedCharSupport): - pass + def event_UIA_notification(self, **kwargs): + """ + In an upcoming terminal release, UIA notification events will be sent + to announce new text. Block these for now to avoid double-reporting of + text changes. + @note: In the longer term, NVDA should leverage these events in place + of the current LiveText strategy, as performance will likely be + significantly improved and #11002 can be completely mitigated. + """ + log.debugWarning(f"Notification event blocked to avoid double-report: {kwargs}")