Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/cli/src/doctor.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use serde::Serialize;
use std::{
path::{Path, PathBuf},
time::Duration,
};
use std::path::{Path, PathBuf};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 std::time::Duration import removed but still needed on macOS. The screen_capture_kit_check function is #[cfg(target_os = "macos")] and calls Duration::from_secs(3) at two sites inside it (lines 362 and 385). With the import gone, the macOS build will fail with "cannot find type/value Duration in this scope". The correct fix is to make the import conditional rather than drop it entirely.

Suggested change
use std::path::{Path, PathBuf};
use std::path::{Path, PathBuf};
#[cfg(target_os = "macos")]
use std::time::Duration;
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/cli/src/doctor.rs
Line: 2

Comment:
`std::time::Duration` import removed but still needed on macOS. The `screen_capture_kit_check` function is `#[cfg(target_os = "macos")]` and calls `Duration::from_secs(3)` at two sites inside it (lines 362 and 385). With the import gone, the macOS build will fail with "cannot find type/value `Duration` in this scope". The correct fix is to make the import conditional rather than drop it entirely.

```suggestion
use std::path::{Path, PathBuf};
#[cfg(target_os = "macos")]
use std::time::Duration;
```

How can I resolve this? If you propose a fix, please make it concise.

#[cfg(target_os = "macos")]
use std::time::Duration;

use crate::{OutputFormat, write_json};

Expand Down Expand Up @@ -456,6 +455,7 @@ fn install_check(install: &Result<cap_cli_install::CliInstallStatus, String>) ->
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rename looks like it’ll break macOS builds: the #[cfg(target_os = "macos")] block in this function still references checks.

Suggested change
}
fn capture_ready(permissions: &Permissions, checks: &[Check]) -> bool {
#[cfg(not(target_os = "macos"))]
let _ = checks;

}

#[cfg_attr(not(target_os = "macos"), allow(unused_variables))]
fn capture_ready(permissions: &Permissions, checks: &[Check]) -> bool {
let permission_ready = match permissions.screen_recording {
#[cfg(target_os = "macos")]
Expand Down
14 changes: 13 additions & 1 deletion apps/desktop/src-tauri/src/general_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ impl MainWindowRecordingStartBehaviour {
}
}

// NOTE: Do not add "Cap Target Select" here — on Windows, WDA_EXCLUDEFROMCAPTURE applied to that
// hidden window causes it to reappear as a ghost overlay after recording ends.
const DEFAULT_EXCLUDED_WINDOW_TITLES: &[&str] = &[
"Cap",
"Cap Settings",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice root-cause writeup in the PR description.

One thing to double-check: changing DEFAULT_EXCLUDED_WINDOW_TITLES only affects new configs — existing users likely already have "Cap Target Select" persisted in excluded_windows (and append_missing_default_excluded_windows won’t remove it). If the ghost overlay reproduces for upgraded users, a small one-time migration on Windows to retain everything except that entry could make the fix apply universally.

Also, to prevent reintroducing this accidentally later, it might be worth leaving a short note here:

Suggested change
"Cap Settings",
// NOTE: Avoid excluding "Cap Target Select" by default; on Windows this can cause a ghost overlay to reappear after recording ends.
const DEFAULT_EXCLUDED_WINDOW_TITLES: &[&str] = &[

"Cap Recording Controls",
"Cap Camera",
"Cap Target Select",
"Cap Window Capture Occluder",
"Cap Capture Area",
"Cap Mode Selection",
Expand Down Expand Up @@ -417,6 +418,17 @@ pub fn init(app: &AppHandle) {
};

append_missing_default_excluded_windows(&mut store.excluded_windows);

const REMOVE_TARGET_SELECT_MIGRATION_KEY: &str = "remove_cap_target_select_exclusion_v1";
if let Ok(raw_store) = app.store("store")
&& raw_store.get(REMOVE_TARGET_SELECT_MIGRATION_KEY).is_none()
{
store.excluded_windows.retain(|w| {
w.window_title.as_deref() != Some("Cap Target Select")
});
raw_store.set(REMOVE_TARGET_SELECT_MIGRATION_KEY, json!(true));
}

crate::posthog::set_telemetry_enabled(store.enable_telemetry);
register_bundled_muxer_binary(app);

Expand Down
Loading