Repository navigation
Description
Vendor parity, not a regression (rulings 689, 690; task 78). Related: candidate 3, ticket C, #374.
On the background route, a Chromium window's context menu opened through an element dies with the request. That covers perform_secondary_action showContextMenu and a right click's showContextMenu fallback. The menu opens, the engine sees it (so candidate 3 answers ok), and it is gone by the answer. An agent that asks for a context menu to pick an item from it finds none. The vendor's builds behave the same, so this is no regression, but it leaves Chromium's context menus unusable through element actions on an unfocused window.
Measured (task 78, private display, Chrome on a page whose button lets the menu open; Chrome's override-redirect windows sampled every ~15 ms through the request; t78/proof3, proof5):
| Engine, request | Menu first seen | Last seen | Answered | Open after the answer |
|---|---|---|---|---|
cua (candidate 3), perform_secondary_action, background |
58 ms | 58 ms | 68 ms | no |
| cua, the right-click fallback, background | 40 ms | 40 ms | 58 ms | no |
pinned vendor, perform_secondary_action, background |
163 ms | 251 ms | 256 ms | no |
| pinned vendor, the right-click fallback, background | 452 ms | 545 ms | 546 ms | no |
cua, perform_secondary_action, Chrome the focused window |
40 ms | ≥347 ms | 55 ms | yes, until Escape |
| cua, the fallback, Chrome the focused window | 38 ms | ≥338 ms | 47 ms | yes |
| cua, window-bound coordinate right click (background route) | not seen | – | 16 ms | no (the page got contextmenu) |
| cua, coordinate right click with no window (desktop route, XTEST) | 92 ms | ≥389 ms | 90 ms | yes |
| XTEST right click (xdotool) | 273 ms | ≥563 ms | – | yes |
Electron behaves the same: its menu was seen at 46–65 ms and gone by the answer at 66 ms (t78/proof4).
- Inference, unproven: the element action's input session closes the menu. On the background route that session sends a synthetic
FocusInbeforeDoActionand aFocusOutas the request ends, and Chromium closes its menus when its window loses focus. With Chrome focused, the session sends neither, and the menu stays.clipboard_read's Copy opens no session, and its menu lives long enough for the Copy item to be activated. - Scope: the close happens only on the background session. With the Chromium window focused, the menu stays (rows 5 and 6), and so does one opened by a desktop-route or XTEST right click (rows 8 and 9).
- The surface's line (ruling 690, in the engine README beside menuUnconfirmed): "In Chromium, a context menu requested on a window that is not focused (perform_secondary_action showContextMenu, the right-button fallback, or a window-bound right click) does not stay open after the request. To use a menu item, focus the window first where you may (on a shared desktop, only when the person allows it), or use the clipboard operations for copy and paste."
- Close when: a menu requested on an unfocused Chromium window is still open 500 ms after the answer, live, in Chrome and in Electron. The design question to settle first is the session lifecycle: whether a
showContextMenuaction needs the synthetic focus at all, and what an open menu's grab does to a shared desktop.
Activity