Skip to content

Leave the painted list focus announcement to the platform - #31169

Open
rezabakhshilaktasaraei wants to merge 1 commit into
telegramdesktop:devfrom
rezabakhshilaktasaraei:lists-platform-focus-announcement
Open

Leave the painted list focus announcement to the platform#31169
rezabakhshilaktasaraei wants to merge 1 commit into
telegramdesktop:devfrom
rezabakhshilaktasaraei:lists-platform-focus-announcement

Conversation

@rezabakhshilaktasaraei

@rezabakhshilaktasaraei rezabakhshilaktasaraei commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Tabbing into the chat list, a message list, the countries list or the languages list announces the current row twice. Taking keyboard focus raises a focus event which the platform resolves through focusChild() - the current row - and each of these lists announced that row from focusInEvent as well.

Only the platform's announcement is left. What focus-in still has to do is point at the right row before it returns: the chat list, the countries and the languages lists already pick it there, and for the two message lists the helper that resolves the focused message - following it across slice changes, or picking the first unread / the newest one - is split from the announcing one, whose other caller (a chat focused before its first messages arrived) has no focus event to rely on and keeps announcing directly.

Needs desktop-app/patches#263 on Windows: Qt 5.15 forwards a focus event to focusChild() only for an accessible exposing a table interface, upstream generalized that to any element with children in 6.2.

Tested with NVDA on Windows 10 against a Qt 5.15.19 build with that patch: all five lists announce their current row once when focus arrives, and browsing inside them with the arrows is unchanged. The list container keeps reporting the focused state, since it is the widget that actually holds keyboard focus - the row is what the focus event and GetFocus resolve to.

Taking keyboard focus raises a focus event which the platform hands to
focusChild(), so the chat list, the message lists, the countries and the
languages lists announced their current row twice: once from the event
and once from focusInEvent. Keep only the platform's announcement and
make sure the row it resolves to is picked before focus-in returns - for
the message lists that means splitting the announcing helper, whose
other caller (a chat focused before its first messages arrived) has no
focus event to rely on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant