Repository navigation
fork: a desktop tab keeps drawing for its viewer while T3's window is hidden - #61
Merged
Merged
Conversation
A webview's screencast sends no frames while Windows counts T3's window hidden (minimized, hidden or covered), so someone viewing the tab from another device saw it freeze. Each capturePage() on the guest draws one frame, so while a tab streams without drawing on its own, the host captures it every 250 ms for 3 s after a frame or an input, then every 2 s, one frame copy at a time with screenshots. Co-Authored-By: Claude Opus 5.5 <[email protected]>
From review: a capture past its 5 s limit no longer lets another start while Electron still runs it, and the wait goes by guest, so a guest attached again still waits on it. A frame no capture brought now spares the tab captures for a second, so a page that changes once a second gets none. A stream restarted within a tick starts at the full rate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es going A clock in a window that shows draws once a second. When its first tick came after captures had started, each tick landed just after a capture, passed for that capture's frame and reset the quiet count, so the tab got four captures a second forever. Now a frame keeps the full rate only when the capture before it brought one, so the next capture that brings none drops the tab to every 2 s, where the clock's next tick shows the page draws on its own. Inputs and the stream's start still give 3 s at the full rate, and so does a page that stops drawing on its own, as when the window hides. Any capturePage() counts, a screenshot nudge's too, and the rest after a page's own frame is 1.5 s, so a clock's tick a little late still counts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
Landing on Alice's yes. At Nov 19, 10:08 AM ET she switched this task's row on her Task Priorities board to Agent with no comment, which accepts the suggested answer to its question. The question:
The suggested answer:
Before merging: all checks pass on this head, Written by Claude Opus 5.5 in Claude Code, running in T3 Code. |
3mdistal
added a commit
that referenced
this pull request
Nov 21, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Captures share the screenshot nudge's captureFrame: none starts while another still runs, and the wait goes by guest, so frame copies still go one at a time (crbug.com/567321049). Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 21, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Captures share the screenshot nudge's captureFrame: none starts while another still runs, and the wait goes by guest, so frame copies still go one at a time (crbug.com/567321049). Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Captures share the screenshot nudge's captureFrame: none starts while another still runs, and the wait goes by guest, so frame copies still go one at a time (crbug.com/567321049). Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Rebuilt on upstream's pingdotgg#40263, which prods a hidden guest with capturePage() while a screenshot waits and replaced the fork's screenshot nudge this patch built on; this sync drops that nudge. The pump's captureFrame counts in upstream's per-guest nativeCaptures and starts none while one of either still runs, and the pump skips a tick while a screenshot runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Rebuilt on upstream's pingdotgg#40263, which prods a hidden guest with capturePage() while a screenshot waits and replaced the fork's screenshot nudge this patch built on; this sync drops that nudge. The pump's captureFrame counts in upstream's per-guest nativeCaptures and starts none while one of either still runs, and the pump skips a tick while a screenshot runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Rebuilt on upstream's pingdotgg#40263, which prods a hidden guest with capturePage() while a screenshot waits and replaced the fork's screenshot nudge this patch built on; this sync drops that nudge. The pump's captureFrame counts in upstream's per-guest nativeCaptures and starts none while one of either still runs, and the pump skips a tick while a screenshot runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 26, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Rebuilt on upstream's pingdotgg#40263, which prods a hidden guest with capturePage() while a screenshot waits and replaced the fork's screenshot nudge this patch built on; this sync drops that nudge. The pump's captureFrame counts in upstream's per-guest nativeCaptures and starts none while one of either still runs, and the pump skips a tick while a screenshot runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3mdistal
added a commit
that referenced
this pull request
Nov 30, 2026
… hidden (#61) While T3's window on Windows is minimized, hidden or covered, a webview's screencast sends no frames, but each capturePage() on the guest draws one. While a tab streams, DesktopBrowserHost's pumpFrames checks it every 250 ms and captures each tick for 3 s after an input or the stream's start, then each tick only while each capture brings a frame, else every 2 s; a frame no capture brought means the window draws, so the tab gets none for 1.5 s. Rebuilt on upstream's pingdotgg#40263, which prods a hidden guest with capturePage() while a screenshot waits and replaced the fork's screenshot nudge this patch built on; this sync drops that nudge. The pump's captureFrame counts in upstream's per-guest nativeCaptures and starts none while one of either still runs, and the pump skips a tick while a screenshot runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Problem
A preview tab an agent opens on Alice's Windows PC lives inside the T3 desktop app there, as an Electron
<webview>. From another device (her MacBook), the browser panel shows it live: the server starts a Chrome DevTools Protocol (CDP) screencast on the tab and forwards each frame. While T3's window on the PC was minimized, hidden or covered by other windows, the tab drew nothing, so the panel stayed blank or froze on its last frame. Clicks and typing still reached the page, but nobody could see what they did.#60 makes the panel open at once and say why it's blank. This PR makes it draw. The two are independent and can land in either order.
What happens on the PC
Measured on the PC with a throwaway Electron 44.10.0 app (Chromium 152, the version T3 ships), showing a webview whose page animates:
win.hide())capturePage()on the guest every 500 mscapturePage()on the guest every 250 mscapturePage()on the guest every 500 mscapturePage()on the window's own page every 500 mscapturePage()on the guest every 500 msWhile
capturePage()runs, Chromium counts the page as visible, so it draws one frame and the screencast sends it. Electron 44 has no way to hold that state (incrementCapturerCount()was removed), so the fix repeats the call. A capture took 10 to 25 ms.Turning off Chromium's covered-window detection (
--disable-features=CalculateNativeWinOcclusion) kept a covered window drawing at full rate, 115 frames in 4 s. It does nothing for a minimized window and changes the whole app, so this PR doesn't use it.What changes
DesktopBrowserHost, the desktop end of the CDP relay, runs a small loop (pumpFrames) for a tab while a screencast of it runs:capturePage()every tick for 3 s after an input or the stream's start, and after that every tick only while each capture brings a frame, else every 2 s. So a hidden page that someone is using, or that changes, draws about 4 frames a second. A still page gets no screencast frame from a capture, so it costs one capture every 2 s and no bandwidth.Frame copies still go one at a time. The existing screenshot nudge already calls
capturePage()for a screenshot stuck 500 ms (FORK.md, "Browser screenshots while Windows hides T3"), and screenshots go one at a time because Chromium below 157 can crash the whole app when a guest's renderer exits with a copy in flight (crbug.com/567321049). The loop shares the nudge's capture, nowcaptureFrame:The last two also change the nudge. They came out of a review of the first commit. A second review found the clock case above: before, a clock whose first tick came after captures started got four captures a second forever.
What doesn't change
Risk
Testing
apps/desktop/src/preview/DesktopBrowserHost.fork.test.ts, new "a streamed tab in a hidden window" tests, with a fake guest and Effect'sTestClock:vp run check:changedon a boat.dev machine didn't complete: the boat tool crashed on the first try and hung on the second.Not yet seen end to end: the real T3 app on the PC with this change, viewed from the MacBook while T3's window is minimized. That needs a fork release with it installed on the PC.
Review focus
captureFrameand what they change for the existing screenshot nudge.Written by Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code