From ae054d70b9bcfcf5f9e87cad6f3cea68638c809a Mon Sep 17 00:00:00 2001 From: TZGyn Date: Wed, 9 Sep 2026 15:09:09 +0800 Subject: [PATCH] Treat any same-app window as popup risk for window capture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owned popups composite their parent even when the windows do not overlap, so the intersection test missed DBeaver-style floating dialogs. Any other window from the same app now routes the pick to the screen crop. 💘 Generated with Crush Assisted-by: Crush:deepseek-v4-flash-0731 --- Sources/Kapture/CaptureController.swift | 5 ++++- build-app.sh | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Sources/Kapture/CaptureController.swift b/Sources/Kapture/CaptureController.swift index b828a87..82f5306 100644 --- a/Sources/Kapture/CaptureController.swift +++ b/Sources/Kapture/CaptureController.swift @@ -329,8 +329,11 @@ final class CaptureController: NSObject { // An overlapping window from the same app means this is an // owned popup — desktopIndependentWindow would composite the // parent too, so capture the screen crop instead. + // Owned popups composite their parent even when the windows + // don't overlap, so ANY other same-app window on screen means + // crop (correct region) instead of the group composite. let ownedRisk = trackedWindows.contains { - $0.id != hover.id && $0.pid == hover.pid && $0.frame.intersects(hover.frame) + $0.id != hover.id && $0.pid == hover.pid } CaptureController.log("tap: window pick id=\(hover.id) pid=\(hover.pid) ownedRisk=\(ownedRisk) \(hover.frame)") finishWindowPick(hover.id, hover.frame, ownedRisk: ownedRisk) diff --git a/build-app.sh b/build-app.sh index af2e2d5..0062a73 100755 --- a/build-app.sh +++ b/build-app.sh @@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST' CFBundleIconFile Icon CFBundleShortVersionString - 1.8.2 + 1.8.3 CFBundleVersion - 82 + 83 LSUIElement NSHighResolutionCapable