diff --git a/Sources/Kapture/CaptureController.swift b/Sources/Kapture/CaptureController.swift index a584dec..c89a8ff 100644 --- a/Sources/Kapture/CaptureController.swift +++ b/Sources/Kapture/CaptureController.swift @@ -61,11 +61,11 @@ final class CaptureController: NSObject { } isSelecting = true previousApp = NSWorkspace.shared.frontmostApplication - if #available(macOS 14.0, *) { - NSApp.activate() - } else { - NSApp.activate(ignoringOtherApps: true) - } + // 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") overlays = NSScreen.screens.map { screen in OverlayWindow( screen: screen, @@ -76,6 +76,7 @@ final class CaptureController: NSObject { } overlays.forEach { $0.makeKeyAndOrderFront(nil) } overlayIDs = overlays.map { $0.windowNumber } + CaptureController.log("begin: \(overlays.count) overlays, ids=\(overlayIDs), active=\(NSApp.isActive)") } /// A window was picked from hover — capture it with rounded corners. diff --git a/build-app.sh b/build-app.sh index 3efc363..e6f7342 100755 --- a/build-app.sh +++ b/build-app.sh @@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST' CFBundleIconFile Icon CFBundleShortVersionString - 1.6.1 + 1.6.2 CFBundleVersion - 61 + 62 LSUIElement NSHighResolutionCapable