-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(windows): remove Cap Target Select from default excluded windows to prevent ghost overlay #1965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3fa4c79
e4e55ae
7f3ec98
6b9ec5a
740b463
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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}; | ||||||||||
| #[cfg(target_os = "macos")] | ||||||||||
| use std::time::Duration; | ||||||||||
|
|
||||||||||
| use crate::{OutputFormat, write_json}; | ||||||||||
|
|
||||||||||
|
|
@@ -456,6 +455,7 @@ fn install_check(install: &Result<cap_cli_install::CliInstallStatus, String>) -> | |||||||||
| } | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This rename looks like it’ll break macOS builds: the
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| #[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")] | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -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", | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Also, to prevent reintroducing this accidentally later, it might be worth leaving a short note here:
Suggested change
|
||||||||
| "Cap Recording Controls", | ||||||||
| "Cap Camera", | ||||||||
| "Cap Target Select", | ||||||||
| "Cap Window Capture Occluder", | ||||||||
| "Cap Capture Area", | ||||||||
| "Cap Mode Selection", | ||||||||
|
|
@@ -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); | ||||||||
|
|
||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::time::Durationimport removed but still needed on macOS. Thescreen_capture_kit_checkfunction is#[cfg(target_os = "macos")]and callsDuration::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/valueDurationin this scope". The correct fix is to make the import conditional rather than drop it entirely.Prompt To Fix With AI