From b8a8124ecfaa742903297735e309bcbcd6324ac4 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Fri, 4 Apr 2025 12:42:44 -0600 Subject: [PATCH] Disable screen capture on windows since it doesn't work yet A revert of this change will be on the `windows-screenshare` branch --- crates/gpui/Cargo.toml | 1 - crates/gpui/src/platform.rs | 9 +++------ crates/gpui/src/platform/windows/platform.rs | 8 +++++--- crates/livekit_client/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index d66ec79a53..b3aff453f9 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -216,7 +216,6 @@ blade-graphics.workspace = true blade-macros.workspace = true flume = "0.11" rand.workspace = true -scap.workspace = true windows.workspace = true windows-core = "0.61" windows-numerics = "0.2" diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs index 64b84080d0..c118aa6249 100644 --- a/crates/gpui/src/platform.rs +++ b/crates/gpui/src/platform.rs @@ -26,12 +26,9 @@ mod test; #[cfg(target_os = "windows")] mod windows; -#[cfg(any( - all( - any(target_os = "linux", target_os = "freebsd"), - any(feature = "wayland", feature = "x11"), - ), - target_os = "windows" +#[cfg(all( + any(target_os = "linux", target_os = "freebsd"), + any(feature = "wayland", feature = "x11"), ))] pub(crate) mod scap_screen_capture; diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs index 2a7e53be44..116b2253d1 100644 --- a/crates/gpui/src/platform/windows/platform.rs +++ b/crates/gpui/src/platform/windows/platform.rs @@ -31,7 +31,7 @@ use windows::{ core::*, }; -use crate::{platform::blade::BladeContext, scap_screen_capture::scap_screen_sources, *}; +use crate::{platform::blade::BladeContext, *}; pub(crate) struct WindowsPlatform { state: RefCell, @@ -397,13 +397,15 @@ impl Platform for WindowsPlatform { } fn is_screen_capture_supported(&self) -> bool { - true + false } fn screen_capture_sources( &self, ) -> oneshot::Receiver>>> { - scap_screen_sources(&self.foreground_executor) + let (mut tx, rx) = oneshot::channel(); + tx.send(Err(anyhow!("screen capture not implemented"))).ok(); + rx } fn active_window(&self) -> Option { diff --git a/crates/livekit_client/Cargo.toml b/crates/livekit_client/Cargo.toml index 471945eb09..f4068be692 100644 --- a/crates/livekit_client/Cargo.toml +++ b/crates/livekit_client/Cargo.toml @@ -44,7 +44,7 @@ livekit = { rev = "80bb8f4c9112789f7c24cc98d8423010977806a6", git = "https://git "__rustls-tls" ] } -[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "windows"))'.dependencies] +[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies] scap.workspace = true [target.'cfg(target_os = "macos")'.dependencies]