Skip to content

fix(windows): Cap UI appears as black rectangle in studio recordings (window exclusion is macOS-only) #1737

@MinitJain

Description

@MinitJain

Bug

On Windows, the Cap recording UI appears as a black rectangle in studio mode recordings, starting from the second recording session. The first recording may be unaffected if the Cap window wasn't visible at capture start.

Root cause

Window exclusion is gated entirely to macOS in apps/desktop/src-tauri/src/recording.rs:

#[cfg(target_os = "macos")]
let excluded_windows = { ... resolve_window_ids(...) };

// later:
#[cfg(target_os = "macos")]
{
    builder = builder.with_excluded_windows(excluded_windows.clone());
}

resolve_window_ids in window_exclusion.rs is also #[cfg(target_os = "macos")] only. On Windows, with_excluded_windows is never called, so Cap's own UI is always captured.

Expected behaviour

Cap's own windows (recording controls, camera overlay, etc.) should be excluded from the screen capture on Windows, matching the macOS behaviour.

Steps to reproduce

  1. Open Cap on Windows
  2. Start a studio mode recording
  3. Stop and open the editor — first recording may look fine
  4. Start a second studio mode recording while the Cap UI is visible
  5. Stop and check the recording — Cap UI appears as a black rectangle

Fix needed

Implement window exclusion for Windows using the appropriate screen capture API (Windows Graphics Capture / DXGI). The exclusion list is already built and available in general_settings::default_excluded_windows() — it just needs to be wired up for the Windows capture pipeline.

Relevant files:

  • apps/desktop/src-tauri/src/recording.rs:874-893 — macOS-only exclusion block
  • apps/desktop/src-tauri/src/window_exclusion.rsresolve_window_ids is macOS-only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions