-
-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Description
In classic WinAPI applications, the first control capable of receiving focus (i.e., with WS_TABSTOP) automatically gets focus when the window is shown. This behavior ensures immediate keyboard accessibility and is crucial for screen reader compatibility (e.g., JAWS, NVDA).
In native-windows-gui, no control receives focus by default after window.set_visible(true), unless it is explicitly set using control.set_focus(). This has been observed with TextBox, but may apply to other controls like Button, ListBox, etc.
As a result:
- The application starts with no active control
- The user must press
Tabbefore any control is interactable - Screen readers may not detect a valid focus target on startup
- Text cursors do not appear automatically in editable controls
Expected behavior
The first focusable control (i.e., one with WS_TABSTOP) should automatically receive focus when the window becomes visible - consistent with WinAPI behavior.
Suggestions
- Ensure focus is assigned to the first focusable control after
set_visible(true)if no other control has it. - Alternatively, include
WS_TABSTOPin default flag sets for focusable controls, and consider adding a focus manager behavior in NWG core.
Environment
native-windows-guiversion: latest (1.0.13)- Windows version: 10
- Rust version: 1.88.0
Metadata
Metadata
Assignees
Labels
No labels