Skip to content

Fix NVDA not announcing on initial window focus#31

Merged
Menelion merged 4 commits intoOire:masterfrom
trypsynth:fix/nvda-initial-focus
Mar 14, 2026
Merged

Fix NVDA not announcing on initial window focus#31
Menelion merged 4 commits intoOire:masterfrom
trypsynth:fix/nvda-initial-focus

Conversation

@trypsynth
Copy link
Contributor

@trypsynth trypsynth commented Mar 14, 2026

Summary

  • On launch with an empty queue, imageListView (TabIndex 0) received initial focus but NVDA treats an empty ListView as silent, announcing nothing
  • Handle the Shown event to move focus to formatComboBox when the list is empty, giving NVDA a meaningful control to announce alongside the window title

Test Plan

  • Launch the app with NVDA running — confirm window title and format dropdown are announced immediately without needing to press Tab
  • Launch the app with image files passed as arguments (if any end up in the queue on load) — confirm focus stays on the ListView

When the app launches with an empty queue, focus lands on the ListView
which NVDA treats as silent. Move initial focus to the format combobox
so the screen reader announces the window title and a meaningful control.
@Menelion
Copy link
Contributor

@trypsynth First of all, thank you so much for the PR! I actually did test with NVDA and noticed this behavior. My question is: is it an NVDA bug and can't we force it somehow to say something meaningful? JAWS says "List view 0 items" here which is expected.

@trypsynth
Copy link
Contributor Author

@Menelion you're right that it's arguably an NVDA bug, but there's no clean way I know of to force NVDA's behavior from WinForms without dirty hacks like injecting a fake invisible list item. The focus-to-combobox approach feels to me like a pragmatic workaround that also makes some UX sense: on an empty queue there's nothing to do in the list, so starting at the format dropdown feels natural. Happy to adjust if you have a cleaner idea in mind, though.

@Menelion
Copy link
Contributor

@trypsynth I actually don't like the idea of moving focus, to be honest. Can we fake a list item with some text, like "Add your images here" in the first column?

@Menelion Menelion added the bug Something is not working as expected label Mar 14, 2026
Replace the focus-shifting approach with a greyed-out placeholder
item ("Add your images here") in the ListView's first column.
NVDA announces it on initial focus without any UX disruption.
The placeholder is hidden as soon as a real image is added and
restored when the queue is cleared. Guards prevent it from being
selected or acted upon.
@trypsynth
Copy link
Contributor Author

@Menelion how's that?

@Menelion
Copy link
Contributor

@trypsynth Cooool! Thank you so much! Probably will release a patch since it's a dealbreaker for NVDA users, I didn't like it myself but had no idea at that moment. Thank you!

@Menelion Menelion merged commit 4002e64 into Oire:master Mar 14, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants