From e22bcb99c4b9f75284d3c2a0e1bc8091a1c6d118 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Wed, 9 Sep 2026 11:46:45 +0800 Subject: [PATCH] Make overlay panels activating so clicks are received MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The session log showed active=false after every activation attempt on macOS 26: cooperative activation is denied for LSUIElement apps, and an inactive app's panels let clicks fall through to the windows below. Remove .nonactivatingPanel so showing the overlay activates the app (previous app focus is restored after capture as before). 💘 Generated with Crush Assisted-by: Crush:deepseek-v4-flash-0731 --- Sources/Kapture/CaptureController.swift | 9 ++++----- build-app.sh | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/Kapture/CaptureController.swift b/Sources/Kapture/CaptureController.swift index c89a8ff..ae3d1eb 100644 --- a/Sources/Kapture/CaptureController.swift +++ b/Sources/Kapture/CaptureController.swift @@ -61,11 +61,10 @@ final class CaptureController: NSObject { } isSelecting = true previousApp = NSWorkspace.shared.frontmostApplication - // Force activation: cooperative NSApp.activate() can silently fail for - // LSUIElement apps, leaving the app inactive — then clicks on the - // overlays pass through to the windows below. - NSApp.activate(ignoringOtherApps: true) - CaptureController.log("begin: creating overlays for \(NSScreen.screens.count) screens") + // Force activation and log whether it stuck — inactive apps don't + // receive overlay clicks. + let activated = NSApp.activate(ignoringOtherApps: true) + CaptureController.log("begin: activate(ignoringOtherApps)=\(activated) active=\(NSApp.isActive)") overlays = NSScreen.screens.map { screen in OverlayWindow( screen: screen, diff --git a/build-app.sh b/build-app.sh index e6f7342..571ff51 100755 --- a/build-app.sh +++ b/build-app.sh @@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST' CFBundleIconFile Icon CFBundleShortVersionString - 1.6.2 + 1.6.3 CFBundleVersion - 62 + 63 LSUIElement NSHighResolutionCapable