Context menus: a submenu never moves the main card (#594, textchat) #608
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/594-menu-placement-textchat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #594. This is the
textchathalf: the nightly the owner runs. Thedailyusehalf is #606. The twocontext_menu.rsfiles have diverged, so they get separate PRs.The bounce, reproduced
The owner's report: right-click a message, hover a submenu row, the submenu opens, the main menu moves up, the cursor is now over a row that doesn't expand, the submenu closes, the menu moves back down, and this repeats every frame.
Cause (
widgets/context_menu.rs,viewandAnchored::layoutontextchat): the main card and the open submenu were laid out as one block,row![main, column![space(offset), submenu]], and that block was moved back inside the window. A submenu running past the bottom or right edge moved the whole block, main card included. iced 0.14'smouse_areare-checks hover whenever its bounds change, even on a redraw with a still cursor. So on the next frame another row was under the cursor, itson_enterclosed or switched the submenu, the block jumped back, and the cycle repeated.tests/menu_placement.rsshows it headlessly, frame by frame with the tree kept:thread 640x480 at (4, 240) row "Mute thread": submenu open/closed by frame [None, Some(5), Some(6), Some(5), Some(6), Some(5), Some(6), Some(5)]. Main cards also moved as soon as a submenu opened, in the message and participant menus. On the old widget, 4 of 5 tests failed with 169 faults.Fix
safePolygon): crossing other rows on the way into the submenu no longer closes it. Leaving that path still does.mouse_areawhether or not a submenu is open.Golden
control_bar_sharingchanges. The stream menu used to sit 15 px higher because its "Stream quality" submenu was open, which is this bug. Now the menu stays where it opened and the submenu is bottom-aligned with its row. I looked at the image before regenerating it.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green.Menus still can't be drawn outside the window. iced overlays live in the window surface, and Wayland gives no way to position a separate popup window, so the fix is stable in-window placement like the web client's.
🤖 Generated with Claude Code