Skip to content

Open keyboard-invoked list menus on their rows - #31182

Open
rezabakhshilaktasaraei wants to merge 2 commits into
telegramdesktop:devfrom
rezabakhshilaktasaraei:keyboard-menu-anchors
Open

Open keyboard-invoked list menus on their rows#31182
rezabakhshilaktasaraei wants to merge 2 commits into
telegramdesktop:devfrom
rezabakhshilaktasaraei:keyboard-menu-anchors

Conversation

@rezabakhshilaktasaraei

Copy link
Copy Markdown
Contributor

Pressing the context menu key on a focused chat or message already opened the menu of the right row - that part came with the earlier keyboard and screen reader work - but the menu itself popped at the position Qt puts into a keyboard-invoked event: the center of an empty input method rect, which lands near the top left corner of the list, nowhere near the row. For messages the reactions selector attaches based on the same position, so it drifted along.

The chat list menu now opens under the selected row, at the position the chat menu shortcut already computes for the events it synthesizes (that path is unchanged, and covers the default list and the search result rows). The message lists rebuild the keyboard event anchored on the visible part of the focused message before the shared handler runs, so everything reading the event position - the menu, the reactions selector, the poll option tabs - lands on the message. The chat type filter menu in search results also anchors on its link instead of the mouse cursor, which an Enter press may have left anywhere.

A mouse-invoked menu keeps opening at the cursor everywhere.

Needs desktop-app/lib_ui#348 for the Ui::ContextMenuPosition helper, the same policy the tab strips adopted. Only the placement of the popups changes - the reachability and content of the menus stay as they are, so screen reader interaction is unaffected.

The context menu key picked the right chat, but the menu popped at the
junk position Qt puts into a keyboard-invoked event - the center of an
empty input method rect. The menu opens under the selected row now, at
the position the chat menu shortcut already computes for the events it
synthesizes; that shortcut path is unchanged. The chat type filter
menu in search results also anchors on its link instead of the mouse
cursor, which an Enter press may have left anywhere.
The context menu key picked the right message, but the menu - and the
reactions selector attached to it - popped at the junk position Qt
puts into a keyboard-invoked event. The event is rebuilt anchored on
the visible part of the focused message before the shared handler runs,
so everything reading the event position lands on the message.
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