DevTools close: the key's turn hides DevTools and gives the page its whole frame (BROWSER VIDEO F5)
Summary
BROWSER VIDEO F5 (handoff resize-videos/BROWSER-VIDEO.md; 120 Hz films of the real app on a fleet mini, 2026-11-02): after the DevTools close key, the docked DevTools stayed on screen and the page kept its docked frame for 3-6 refreshes. The pane changed only on Chromium's DEVTOOLS_CLOSED, which arrives after Chromium has torn down the DevTools browser (CloseDevTools -> OnBeforeClose), some turns later.
Chrome hides the docked DevTools view and gives the page its whole area when the close is asked; the backend finishes later. cmux now does the same (CEFDevToolsController.closeInThisTurn). In the close key's turn:
- The DevTools host view and the divider are hidden. The fork's tracker hides the DevTools page window with its parent view, as for a parked tab.
- The tab's DevTools state becomes closed, so focus returns to the page in the same turn.
- The page is laid out at its whole frame.
DEVTOOLS_CLOSED now only frees the views. An open asked before that event (the toggle again) waits for it, because the shim would only focus the closing DevTools. A toggle after that takes the pending open back. setContentVisible(true) keeps a closing DevTools hidden. DevTools in Chromium's own window (fork without embedded DevTools) close as before.
Regression test
CEFDevToolsCloseTests (red commit 2a3d98100a1, fix bafa181802e):
- The close key's turn (
.closeand.toggle, right and bottom dock) gives the page its whole area, hides the DevTools area and sets the state closed beforeDEVTOOLS_CLOSED. The event then frees the views. - An open during the close goes once, after
DEVTOOLS_CLOSED. - A second toggle during the close takes the pending open back.
Command: proof-step.py red|green --branch cp/devtools-close-in-key-turn --suite CEFDevToolsCloseTests
Observed / Not run
- Red on the fleet: step f9801d0eef6518e5d94d46e9 at 2a3d98100a1.
CEFDevToolsCloseTestsfailed 2 of 3 tests, with 17 issues. - Green on the fleet: step cbbf742d67763d59d0b56801 at 0b8e75eb1a2. All 5 tests passed.
- Fleet compile-check v2 of 0b8e75eb1a2 passed (job 0338b964dfb53e378fb0b2fe). The prepush gate has no new violations.
- 120 Hz film (green build 07b5a349, 9 closes):
- The DevTools area is gone 2-4 refreshes after the key. Before this change, it took 3-6.
- The page reaches its full size 5-7 refreshes after the key, the same as before. That frame is Chromium's paint at the new size.
- Every close: flash 0, jump 0, and the layout comes back exactly.
- Not run: the red film of this exact base did not reach its closes on cmux21 and is running again. The page's own Inspect during the close has a unit test only.
Changelog
Fixed: Closing docked DevTools removes it 1-2 frames sooner; the page then grows to its full size when Chromium repaints it.
No capture: the evidence is the 120 Hz frame film that follows here (the gallery has no DevTools state).
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes docked DevTools closing so the page gets its full frame in the close key's turn, instead of keeping the DevTools pane on screen for several refreshes after Chromium was asked to close.
The close now hides the DevTools area, marks the tab closed, and re-lays the page immediately; Chromium's DEVTOOLS_CLOSED event only frees the views afterward. An open requested mid-close waits for that event, and a second toggle during the close cancels the pending open. DevTools in Chromium's own window close as before.
Edge cases covered by the follow-up
- A DevTools Chromium itself opens during the close shows in the views, and the older close's event no longer matches it.
- A panel asked during the close waits for
DEVTOOLS_CLOSED. - A cmux-closed DevTools stays hidden until Chromium reports it closed, and takes no drag share.