Windows Forms (.NET 8): first Alt into the menu bar is not announced when focus came from an MSAA-only list; MSAA focus dropped as native UIA, no UIA FocusChanged
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- accessibility
Research direction
Start by tracing NVDA's handling of MSAA EVENT_OBJECT_FOCUS and UIA FocusChanged events for Windows Forms menus; the report does not name NVDA files or tests. Reproduce with the supplied .NET 8 Windows Forms MenuStrip and MSAA-only ListView setup, comparing the first and second Alt presses. Done means the first Alt announces the focused menu item in the reported case.
Written by the indexing model from the issue text.
Description
Note from the reporter: I am a blind NVDA user, not a developer of NVDA or Windows Forms. This issue was investigated and written by an AI assistant (Claude) that works on my own app. I have little technical knowledge of what is described below, so please read it at that level: the measurements are real, but the interpretation may be incomplete or wrong. I am happy to run further tests if you tell me what to do.
Steps to reproduce
Observed in our own (private) .NET 8 Windows Forms app. Not yet reproduced in a minimal app.
- A .NET 8 Windows Forms window with a
MenuStrip(set asMainMenuStrip) and aListView. - The
ListViewis subclassed so thatWM_GETOBJECTgoes toDefWndProc. Windows then exposes it through the standard oleacc MSAA object of SysListView32 instead of the Windows Forms UIA provider. We did this because, with the .NET 8 UIA provider, NVDA stayed silent after Alt+Tab (the focused list item reports HasKeyboardFocus = false). - Start the app. NVDA correctly says "PlayPal, window" and "Afspeellijst, list" (the list has focus).
- Press Alt once to enter the menu bar.
- Press Escape, then press Alt again.
Actual behavior
- First Alt after starting the app: NVDA says nothing (0 of 9 attempts). The menu bar is active and on "File" ("Bestand"); Right Arrow moves to the next menu and is spoken.
- Second Alt: "Bestand, collapsed, Alt+B, 1 of 4" (every time).
- If the window is activated a second time (for example Alt+Tab away and back), the first Alt is spoken.
- With the same app built with a plain
ListView(UIA provider, no subclass), the first Alt is always spoken (5 of 5).
Expected behavior
The first Alt announces the focused menu bar item, just like the second one.
What the logs show
NVDA debug log with the MSAA and UIA categories enabled, first Alt:
- MSAA events for the menu bar arrive (
EVENT_SYSTEM_MENUSTARTandEVENT_OBJECT_FOCUSwithOBJID_CLIENT, childID 1, state focused), but NVDA drops them:Native UIA window. Dropping winEvent EVENT_OBJECT_FOCUS, window ... (WindowsForms10.Window.8.app...), objectID OBJID_CLIENT, childID 1. - Via UIA only a
MenuOpenedevent arrives for the menu bar, which is ignored:HandleAutomationEvent: Ignoring event gainFocus because ignored by object itself. - No
handleFocusChangedEventarrives for the "Bestand" menu item.
Second Alt: handleFocusChangedEvent called with element Bestand menu-item ... frameworkID WinForm, then Queuing NVDA gainFocus event, and the item is spoken.
An out-of-process UIA client of our own (AddAutomationFocusChangedEventHandler) did receive a FocusChanged event for "Bestand" (HasKeyboardFocus true) on the first Alt as well. Windows sends the same MSAA events for the first and the second Alt.
So the first menu focus seems to fall between two paths: the MSAA focus is dropped because the window is native UIA, and NVDA receives no UIA FocusChanged event the first time. This may be related to the earlier focus coming from an MSAA (non-UIA) control in the same process. It may also be related to #20891 (Windows Forms menus and UIA MenuOpened), but it is a different symptom.
Our workaround: shortly after the window is shown, the app enters and leaves menu mode once (posting WM_SYSKEYDOWN/WM_SYSKEYUP for Alt and then Escape to its own window). After that, the first real Alt is spoken (5 of 5).
System configuration
NVDA installed/portable/running from source
Installed
NVDA version
2026.2 (AMD64)
Windows version
Windows 11 26H2 (10.0.26300.9550) AMD64
Name and version of other software in use when reproducing the issue
Our own app, .NET 8.0.32 Windows Forms, x64.
Other information about your system
Dutch (nl-NL) Windows and NVDA.
Other questions
Does the issue still occur after restarting your computer?
Not tested after a computer restart; it occurs after restarting NVDA.
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?
Not tested.
Does the issue still occur after you run the System Accessibility Repair Tool in NVDA's tools menu?
Not tested.
- 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