From b765e74cd2f35969cb02510d7350d8f3aca4b04f Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Wed, 28 Oct 2026 20:20:54 +0000 Subject: [PATCH] fix(desktop-gpui): skip the picker glass capture on Windows display and window pickers --- apps/desktop-gpui/src/target_overlay.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/desktop-gpui/src/target_overlay.rs b/apps/desktop-gpui/src/target_overlay.rs index f9769cae6a..28cc9b5b91 100644 --- a/apps/desktop-gpui/src/target_overlay.rs +++ b/apps/desktop-gpui/src/target_overlay.rs @@ -825,6 +825,19 @@ fn more_area_ratios() -> Vec<(u32, u32)> { .collect() } +/// Whether the picker captures the desktop under its glass in `mode`. +/// Windows composites the display and window pickers' target fill opaque, +/// so a capture under their panes showed through it as hard-edged blocks; +/// there the panes sit on the fallback fill, as they do where no capture +/// is possible. +fn backdrop_suits(mode: Option) -> bool { + match mode { + None => false, + Some(TargetType::Display | TargetType::Window) => !cfg!(windows), + Some(TargetType::Area | TargetType::CameraOnly) => true, + } +} + const AREA_RESHAPE: Duration = Duration::from_millis(240); /// What the picker's glass sits on when there is no capture of the desktop @@ -1551,7 +1564,7 @@ impl OverlayWindow { fn sync_backdrop(&mut self, window: &mut Window, cx: &mut Context) { let showing = crate::overlay_backdrop::enabled() && !self.recording_area - && self.select.read(cx).mode.is_some() + && backdrop_suits(self.select.read(cx).mode) && self.is_active_display(window, cx); if !showing { if self.backdrop.has_image() { @@ -4688,6 +4701,15 @@ fn request_media_access(permission: crate::permissions::OSPermission, cx: &mut A mod tests { use super::*; + #[test] + fn windows_display_and_window_pickers_take_no_backdrop() { + assert!(!backdrop_suits(None)); + assert!(backdrop_suits(Some(TargetType::Area))); + assert!(backdrop_suits(Some(TargetType::CameraOnly))); + assert_eq!(backdrop_suits(Some(TargetType::Display)), !cfg!(windows)); + assert_eq!(backdrop_suits(Some(TargetType::Window)), !cfg!(windows)); + } + fn ratio_of(area: AreaRect) -> f32 { area.width / area.height }