Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

macOS: target thumbnail screenshot can hang, leaving the screen-recording indicator (and "Your screen is being observed") stuck — even after Cap quits

Aperta
#2,339 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
macos, rust, tauri
Ambito
cli, desktop

Direzione di ricerca

The issue is in the thumbnail capture code in apps/desktop/src-tauri/src/thumbnails/mod.rs and mac.rs. The capture_sample_buf call hangs, blocking the command. Start by examining the async flow and the block_in_place usage in recording.rs. Look for how to add a timeout or switch to using SCStream with explicit stopCapture. Test by running the app and monitoring replayd logs to see if a hung session is created and if the fix releases it. 'Done' means the screen-recording indicator clears after the app quits, even after a simulated hang.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

On launch (no recording started), Cap captures display/window thumbnails with SCScreenshotManager. One of those screenshot requests never completed. While it was pending, macOS kept a screen-capture session open for Cap, so the purple screen-recording indicator stayed on and the lock screen showed "Your screen is being observed".

After Cap quit, replayd ran its per-client cleanup (stopAllStreamsWithError), but the stuck screenshot stream was not released. The indicator kept attributing screen capture to so.cap.desktop until I force-restarted replayd.

The hang itself looks like a ScreenCaptureKit/macOS issue, and so does the missing cleanup on exit. On Cap's side, the Tauri app awaits each thumbnail with no timeout. Once a request hangs, nothing on Cap's side can end it.

Environment

  • Cap desktop 0.6.0 (Tauri app, /Applications/Cap.app, bundle id so.cap.desktop)
  • macOS 27.0 (build 26A428)
  • MacBookPro18,3 (Apple Silicon), single built-in display

Steps to reproduce

  1. Make sure Cap is not running and no screen-recording indicator is shown.
  2. In Terminal, start watching the indicator and capture sessions:
    log stream --style compact --predicate '(process == "ControlCenter" AND category == "sensor-indicators") OR (process == "replayd" AND eventMessage CONTAINS "SLContentStream")'
    
  3. Launch Cap. Do not start a recording.
  4. Count SLContentStream start: against SLContentStream stop: lines, and watch whether Active activity attributions stays at ["scr:so.cap.desktop"].
  5. Quit Cap and check whether the indicator clears.

This reproduced on my first attempt. I have not measured how often it happens.

What I observed

Clean launch at 08:06:18, no recording:

08:06:18.441  SLContentStream start   -> 08:06:18.459 stop   (ok)
08:06:18.566  SLContentStream start   -> 08:06:18.567 stop   (ok)
08:06:18.679  SLContentStream start   -> 08:06:18.681 stop   (ok)
08:06:18.743  SLContentStream start   -> never stopped        <-- hung
08:06:46.545  SLContentStream start   -> 08:06:46.550 stop   (ok)
08:07:10.690  SLContentStream start   -> 08:07:10.702 stop   (ok)

Every start came from +[SCScreenShotSession captureSLContentStreamScreenshot:withCompletionHandler:], so these are screenshot sessions, not recording streams. From 08:06:18.743 on, ControlCenter reported:

Active activity attributions changed to ["scr:so.cap.desktop"]

Quit at 08:07:39:

08:07:39.443 replayd  invalidated because the client process (pid 23425) either cancelled the connection or exited
08:07:39.444 replayd  -[RPClient stopAllStreamsWithError:stopReason:] stopReason=0
08:08:06.150 ControlCenter  Sorted active attributions from SystemStatus update: [[scr] Cap (so.cap.desktop)]   <-- Cap is gone, indicator still on

The indicator only cleared after replayd was killed. launchd then restarted it.

Earlier, in normal use (before I knew the cause)
  • ControlCenter attributed 2–3 concurrent scr sessions to Cap for about 17 hours. Cap's own log (~/Library/Logs/so.cap.desktop) shows only two short studio recordings (5–6 s each) in that period, and both pipelines shut down cleanly.
  • The long-lived sessions started shortly after a sleep/wake. Cap logged System woke from sleep; scheduling recovery refresh at that point.
  • Cap exited normally (Exit cleanup completed elapsed_ms=11). One scr attribution then stayed for more than 3 hours until replayd was restarted.

My guess is that each thumbnail refresh (for example after wake) can leak one more hung session. I could not confirm this because the detailed logs from that period had already rotated.

Relevant code (tag cap-v0.6.0)

What I don't know

  • Which display or window the hung request was for. replayd logs the filter as <private>.
  • Whether this reproduces on macOS 26.x, or only on 27.0.

Possible mitigations

  1. Put a per-thumbnail timeout around capture_sample_buf (for example 2 s) and skip that target on timeout. This keeps the picker from blocking. It probably does not clear the indicator, because SCScreenshotManager has no cancel API and dropping the future leaves the system session open.
  2. For thumbnails, use a short-lived SCStream (the existing scap_screencapturekit::Capturer): take the first frame, then call stopCapture explicitly, including on timeout. Cap then owns the session's lifetime. I have not verified that stopCapture releases a stream that never delivered a frame.
  3. The missing cleanup on exit (the screenshot session survives the client's stopAllStreams) looks like a macOS bug. It is probably worth a Feedback Assistant report to Apple as well.

Workaround for affected users: quit Cap, then reboot, or run killall -9 replayd (launchd restarts it).

Lingua principale
Rust
Stelle
22.5k
Fork
1.9k
Merge medio
7h 43m
PR unite (30g)
80

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CapSoftware/Cap

Tutte le issue di CapSoftware/Cap

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.