Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: keep Windows capture targets and window controls usable

Richie McIlroydfc8c89e1e86
diff --git a/apps/desktop-gpui/src/devices.rs b/apps/desktop-gpui/src/devices.rs
index 3d967566f..21976bf7b 100644
--- a/apps/desktop-gpui/src/devices.rs
+++ b/apps/desktop-gpui/src/devices.rs
@@ -380,6 +380,11 @@ pub fn list_window_targets() -> Vec<(WindowOption, Window)> {
Window::list()
.into_iter()
.filter_map(|window| {
+ #[cfg(target_os = "windows")]
+ if !window.raw_handle().is_valid() || !window.raw_handle().is_on_screen() {
+ return None;
+ }
+
let label = window.name().filter(|name| !name.trim().is_empty())?;
let app = window.owner_name()?;
diff --git a/apps/desktop-gpui/src/main_window.rs b/apps/desktop-gpui/src/main_window.rs
index 11bd2e252..80ec9cd41 100644
--- a/apps/desktop-gpui/src/main_window.rs
+++ b/apps/desktop-gpui/src/main_window.rs
@@ -2665,6 +2665,9 @@ impl MainWindow {
.id("microphone-warning")
.absolute()
.inset_0()
+ .when(cfg!(target_os = "windows"), |overlay| {
+ overlay.top(px(HEADER_HEIGHT))
+ })
.rounded(px(16.))
.occlude()
.flex()
@@ -3383,6 +3386,9 @@ impl MainWindow {
div()
.absolute()
.inset_0()
+ .when(cfg!(target_os = "windows"), |overlay| {
+ overlay.top(px(HEADER_HEIGHT))
+ })
.rounded(px(16.))
.flex()
.flex_col()
diff --git a/apps/desktop-gpui/src/onboarding_window.rs b/apps/desktop-gpui/src/onboarding_window.rs
index 9154b9267..36265a541 100644
--- a/apps/desktop-gpui/src/onboarding_window.rs
+++ b/apps/desktop-gpui/src/onboarding_window.rs
@@ -2520,7 +2520,7 @@ impl Render for OnboardingWindow {
theme,
window.is_window_active(),
window.is_maximized(),
- false,
+ true,
false,
));
#[cfg(not(target_os = "windows"))]