Compare commits

..
2 Commits
Author SHA1 Message Date
TZGyn e22bcb99c4 Make overlay panels activating so clicks are received
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
2026-09-09 11:46:45 +08:00
TZGyn 457e303152 Force app activation on capture; log to /tmp for durable diagnostics
Cooperative NSApp.activate() can silently fail for LSUIElement apps,
leaving the app inactive so overlay clicks pass through to windows below.
Force activation with ignoringOtherApps on all OS versions. Session logs
now also append to /tmp/kapture-debug.log so they survive relaunches, and
the first window-scan result is always logged.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4-flash-0731
2026-09-09 11:00:44 +08:00
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -61,11 +61,10 @@ final class CaptureController: NSObject {
} }
isSelecting = true isSelecting = true
previousApp = NSWorkspace.shared.frontmostApplication previousApp = NSWorkspace.shared.frontmostApplication
if #available(macOS 14.0, *) { // Force activation and log whether it stuck — inactive apps don't
NSApp.activate() // receive overlay clicks.
} else { let activated = NSApp.activate(ignoringOtherApps: true)
NSApp.activate(ignoringOtherApps: true) CaptureController.log("begin: activate(ignoringOtherApps)=\(activated) active=\(NSApp.isActive)")
}
overlays = NSScreen.screens.map { screen in overlays = NSScreen.screens.map { screen in
OverlayWindow( OverlayWindow(
screen: screen, screen: screen,
@@ -76,6 +75,7 @@ final class CaptureController: NSObject {
} }
overlays.forEach { $0.makeKeyAndOrderFront(nil) } overlays.forEach { $0.makeKeyAndOrderFront(nil) }
overlayIDs = overlays.map { $0.windowNumber } 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. /// A window was picked from hover — capture it with rounded corners.
+2 -2
View File
@@ -108,9 +108,9 @@ cat > "$APP/Contents/Info.plist" <<'PLIST'
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>Icon</string> <string>Icon</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.6.1</string> <string>1.6.3</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>61</string> <string>63</string>
<key>LSUIElement</key> <key>LSUIElement</key>
<true/> <true/>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>