Skip to content

fix(desktop-gpui): stop macOS picker thumbnail streams - #4785

Open
jatmn wants to merge 3 commits into
CapSoftware:mainfrom
jatmn:fix/2339-macos-thumbnail-capture
Open

jatmn wants to merge 3 commits into
CapSoftware:mainfrom
jatmn:fix/2339-macos-thumbnail-capture

Conversation

@jatmn

@jatmn jatmn commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2339

What changed

Cap now owns the ScreenCaptureKit stream it uses for each macOS picker thumbnail. It requests a stop after receiving a frame or after the capture deadline expires. The stop acknowledgement has its own deadline, so a slow stop cannot block the picker indefinitely. The earlier timeout in #2460 returned control to Cap without giving it a native stream handle to stop.

Cap requests BGRA for thumbnail streams so an odd-width frame can use the packed-pixel conversion path. On macOS, the previous NV12 conversion rejected a 69-pixel-wide frame from a narrow window, leaving its thumbnail blank.

The native stop callback retains the stream, output queue, and delegate until completion. If waiting for the stop acknowledgement times out, Cap pauses further captures and keeps any frame it already received.

Validation

  • Earlier Linux validation covered cargo check --locked -p cap-desktop-gpui, scoped Rust formatting, and a focused timeout test with a simulated frame source and stop operation.
  • macOS 27.0.1 (build 26A434), Apple silicon, Xcode 27.2. cargo build --locked --bin cap-gpui and cargo check --locked -p cap-desktop-gpui passed.
  • cargo test --locked --bin cap-gpui target_thumbnails::tests -- --test-threads=1 passed all 30 picker tests. cargo test --locked -p scap-screencapturekit --lib passed the native delegate deallocation test.
  • Scoped Rust formatting passed for both changed Rust files. The workspace formatter reported pre-existing formatting differences in the same 70 files as the previous head.

macOS verification

  • The live display and narrow-window thumbnails kept their proportions and refreshed when the content changed. The narrow window produced a centered 69×180 image in the native test.
  • After real sleep and wake, the display picker produced its first thumbnail in about 5.5 seconds. The display showed the current foreground, and the reopened window picker showed the updated test pattern.
  • With recording idle, the filtered replayd log contained 44 matched stream start and stop pairs in the live picker run and 67 in the sleep/wake run. Control Center showed no active capture after quit. The lock screen showed no “Your screen is being observed” message.
  • With delivery of a real ScreenCaptureKit frame deliberately withheld, the five-second frame deadline fired, Cap paused further captures, and ScreenCaptureKit acknowledged the stop.
  • In a separate controlled case, the native stop callback completed successfully and its acknowledgement was withheld from the picker task. The five-second acknowledgement deadline fired, Cap paused further captures, and the captured thumbnail remained usable. Across the three native harness cases, replayd logged four matched stream start and stop pairs.
  • The original intermittent hang did not occur in the full-app runs.

Capture attribution was checked using the system log filter from the original report.

log stream --style compact --predicate '(process == "ControlCenter" AND category == "sensor-indicators") OR (process == "replayd" AND eventMessage CONTAINS "SLContentStream")'

macOS-tested commit 0405953775348bb6d9df9752ffa0aaef2f7a002d.

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge; no actionable defects were found.

Summary

Replaces macOS picker screenshots with owned ScreenCaptureKit streams.

  • Each macOS picker thumbnail stops its stream after a frame or timeout.
  • MacOS picker thumbnails use fitted BGRA frames.

Reviews (1) · Last reviewed commit: "fix(desktop-gpui): retain thumbnail stre..." · Reviewed by Greptile

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Dec 2, 2026 6:17pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 17:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status December 2, 2026 18:17 Inactive
@vercel

vercel Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@jatmn is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@jatmn
jatmn marked this pull request as ready for review December 2, 2026 19:42

This branch was previously deployed

1 inactive (outdated) deployment
Preview – cap-status — e71fc4ac Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant