UIA: no focus speech in a UWP XAML text control on Windows 10; GetAttributeValues faults on a null LinkAttribute
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- accessibility, desktop
Research direction
Start in NVDAObjects/UIA/init.py at _getFormatFieldAtRange and inspect how it uses BulkUIATextRangeAttributeValueFetcher and UIATextRangeAttributeValueFetcher from UIAHandler/utils.py. Reproduce on Windows 10 with the reported UWP XAML control and check the bulk fetch behavior when UIA_LinkAttributeId faults. Done when focus speech completes and caret or selection reporting works for this case without breaking other text attribute retrieval.
Written by the indexing model from the issue text.
Description
Steps to reproduce
- On Windows 10, install Unigram 13.1 (Telegram for Windows) from the Microsoft Store and sign in.
- Open any chat.
- Press Tab until focus reaches the message box.
Actual behavior
Nothing is spoken when the message box takes focus. Typed characters are echoed, but caret movement and selection are not reported afterwards. The log shows:
ERROR - eventHandler.executeEvent (07:22:01.380) - MainThread (2620):
error executing event: gainFocus on <NVDAObjects.Dynamic_XamlEditableTextEditableTextWithAutoSelectDetectionUIA object at 0x0000018BE524E6D0> with extra args of {}
Traceback (most recent call last):
File "eventHandler.pyc", line 354, in executeEvent
File "eventHandler.pyc", line 120, in __init__
File "eventHandler.pyc", line 129, in next
File "NVDAObjects\behaviors.pyc", line 338, in event_gainFocus
File "NVDAObjects\UIA\__init__.pyc", line 1589, in event_gainFocus
File "NVDAObjects\__init__.pyc", line 1372, in event_gainFocus
File "NVDAObjects\__init__.pyc", line 1208, in reportFocus
File "speech\speech.pyc", line 855, in speakObject
File "speech\speech.pyc", line 922, in getObjectSpeech
File "speech\types.pyc", line 55, in _flattenNestedSequences
File "speech\types.pyc", line 55, in <genexpr>
File "speech\speech.pyc", line 1595, in getTextInfoSpeech
File "NVDAObjects\UIA\__init__.pyc", line 1033, in getTextWithFields
File "NVDAObjects\UIA\__init__.pyc", line 1021, in _getTextWithFieldsForUIARange
File "NVDAObjects\UIA\__init__.pyc", line 690, in _getTextWithFields_text
File "NVDAObjects\UIA\__init__.pyc", line 412, in _getFormatFieldAtRange
File "UIAHandler\utils.pyc", line 266, in __init__
OSError: exception: access violation reading 0x0000000000000000
Expected behavior
The edit field and its line are announced, as they are with NVDA on Windows 11 against the same app.
Analysis
The message box is a custom UWP XAML control whose text pattern is a managed ITextRangeProvider. Where a range has no link, the provider returns null for UIA_LinkAttributeId. XAML special-cases that attribute (CUIATextRangeProviderWrapper::GetAttributeValue in microsoft-ui-xaml) and hands UIA a VT_UNKNOWN whose punkVal is null.
BulkUIATextRangeAttributeValueFetcher then calls IUIAutomationTextRange3::GetAttributeValues, which on Windows 10 raises an access violation reading address 0 inside NVDA's process. ctypes surfaces it as OSError. Nothing catches it, so the whole focus announcement is lost.
From the NVDA Python console, we requested each attribute on its own through GetAttributeValues, with the caret on a line without a link. Only UIA_LinkAttributeId faulted. The rest returned normally:
Link FAILED exception: access violation reading 0x0000000000000000
AnnotationTypes None
FontName 'Segoe UI, ms-appx:///Assets/Emoji/apple.ttf#Segoe UI Emoji'
FontSize 14.0
StyleId 70012
StyleName None
Culture None
FontWeight 400
IsItalic False
HorizontalTextAlignment 0
ForegroundColor None
LineSpacing None
We did not test whether the single-attribute GetAttributeValue(UIA_LinkAttributeId) faults too.
From the XAML source, any UWP app with a managed text provider that returns no range for UIA_LinkAttributeId should hit the same fault on Windows 10. We have only seen it in Unigram.
Unigram will work around it in its next release by returning UIA's NotSupported value instead: XAML maps a NotSupportedException from the provider to it. Unigram 13.1, the current Store release, still returns the null link.
Suggestion
When GetAttributeValues raises, fall back to UIATextRangeAttributeValueFetcher. Alternatively, leave UIA_LinkAttributeId out of the bulk fetch on Windows 10. Windows 10 no longer receives fixes, so NVDA is the only place this can be handled.
System configuration
NVDA installed/portable/running from source
Installed
NVDA version
2026.2
Windows version
Windows 10 22H2, build 19045
Name and version of other software in use when reproducing the issue
A development build of Unigram, made after 13.1. We did not run the Store release itself, but its text provider returns the same null link.
Other information about your system
Windows 10 running in a virtual machine.
Other questions
Does the issue still occur after restarting your computer?
Not tried. It reproduces every time the message box takes focus.
Have you tried any other versions of NVDA? If so, please report their behaviors
No.
If NVDA add-ons are disabled, is your problem still occurring?
No add-ons installed (fresh install).
Does the issue still occur after you run the System Accessibility Repair Tool in NVDA's tools menu?
Not run.
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 842
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nvaccess/nvda
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
needs-technical-investigation p5 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nvaccess/nvda#21085 · 7 comments ·
Maintainers usually reply within 1 day
-
Braille Viewer draws two braille patterns wrongly (U+28CC, U+2873) because of glyph errors in FreeMono-FixedBraille.ttfMay be free again A pull request for this issue was closed without being merged. Openaudience/a11y-tester good first issue p4 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nvaccess/nvda#21022 · 3 comments ·
Maintainers usually reply within 1 day
-
api-breaking-change audience/nvda-dev p5 release/blocking release/blocking-beta triaged
Difficulty 2/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
p5 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pimutils/vdirsyncer#1242 ·
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/lean-cli#792 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-webui/open-webui#35360 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100