Skip to content

feat(accessibility): support SetFocus and Press actions on painted list items#303

Open
rezabakhshilaktasaraei wants to merge 2 commits into
desktop-app:masterfrom
rezabakhshilaktasaraei:accessibility/item-set-focus
Open

feat(accessibility): support SetFocus and Press actions on painted list items#303
rezabakhshilaktasaraei wants to merge 2 commits into
desktop-app:masterfrom
rezabakhshilaktasaraei:accessibility/item-set-focus

Conversation

@rezabakhshilaktasaraei

@rezabakhshilaktasaraei rezabakhshilaktasaraei commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Painted/virtual list items exposed via Accessible::Item advertise themselves as focusable, but they provided no QAccessibleActionInterface. As a result a screen reader could neither move focus to such an item (UIA SetFocus returned UIA_E_ELEMENTNOTAVAILABLE) nor activate it (UIA Invoke had nothing to call).

This makes Accessible::Item implement QAccessibleActionInterface and forward the two relevant actions to the owning widget:

  • interface_cast now returns the action interface.
  • actionNames() advertises pressAction() (the item's default activate action) and, when the parent reports the row as focusable, setFocusAction().
  • doAction() routes:
    • setFocusAction() -> new RpWidget::accessibilityChildSetFocus(int index)
    • pressAction() -> new RpWidget::accessibilityChildActivate(int index)

Both new RpWidget virtuals default to no-ops, so the owning widget can opt in and translate the requests into its own selection / activation model (e.g. the chat list moving its selection, or opening the chat).

@rezabakhshilaktasaraei rezabakhshilaktasaraei changed the title feat(accessibility): support SetFocus action on painted list items feat(accessibility): support SetFocus and Press actions on painted list items Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant