Open keyboard-invoked list menus on their rows - #31182
Open
rezabakhshilaktasaraei wants to merge 2 commits into
Open
Open keyboard-invoked list menus on their rows#31182rezabakhshilaktasaraei wants to merge 2 commits into
rezabakhshilaktasaraei wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.