Skip to content

Add a selection event for a painted list child - #345

Open
rezabakhshilaktasaraei wants to merge 1 commit into
desktop-app:masterfrom
rezabakhshilaktasaraei:accessible-child-selection-event
Open

Add a selection event for a painted list child#345
rezabakhshilaktasaraei wants to merge 1 commit into
desktop-app:masterfrom
rezabakhshilaktasaraei:accessible-child-selection-event

Conversation

@rezabakhshilaktasaraei

@rezabakhshilaktasaraei rezabakhshilaktasaraei commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

A painted list has no way to tell a screen reader that a row became the current one, or stopped being. accessibilityChildStateChanged() with the selected flag looks like it should do it, but on Windows the bridge reads only the checked flag out of a state change (qwindowsuiamainprovider.cpp, notifyStateChange). So the chat folder tabs stayed silent on activation, while the folders that are real widgets say "selected" - SideBarButton::setActive() raises the selection event itself.

accessibilityChildSelectionChanged(index) does the same for a virtual child. It raises SelectionAdd for a deselection as well, which reads odd but is deliberate: SelectionRemove is mapped nowhere in the bridge (in qtbase dev either, not just 5.15), and a screen reader reads the new value off the child and announces the difference - so it only needs telling that the selection of this child changed. Verified in a log: NVDA answers the event with a state comparison, saying just "selected" or "not selected", and stays quiet when the value did not actually change.

Used by telegramdesktop/tdesktop#31097 when a slider section is activated, and by telegramdesktop/tdesktop#31171 when a message is selected or deselected. Both verified with NVDA on Windows 10.

A painted list had no way to tell a screen reader that a row became the
current one, or stopped being: the Windows bridge reads only the checked
flag out of a state change and ignores the selected one, so the folder
tabs went silent where the folders that are real widgets say "selected" -
SideBarButton raises the selection event itself.
@rezabakhshilaktasaraei
rezabakhshilaktasaraei force-pushed the accessible-child-selection-event branch from 1076ff6 to 3656218 Compare August 25, 2026 07:02
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