Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7cad2fc2f |
@@ -21,6 +21,17 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
runOCRSelfTest()
|
runOCRSelfTest()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Single instance: stale copies keep their own hotkey + overlays alive
|
||||||
|
// after app updates and eat clicks meant for the new instance.
|
||||||
|
let myPid = ProcessInfo.processInfo.processIdentifier
|
||||||
|
let others = NSRunningApplication.runningApplications(withBundleIdentifier: "dev.tzgyn.kapture")
|
||||||
|
.filter { $0.processIdentifier != myPid }
|
||||||
|
if !others.isEmpty {
|
||||||
|
CaptureController.log("launch: other Kapture instances pids=\(others.map { String($0.processIdentifier) }.joined(separator: ",")) — terminating them")
|
||||||
|
for other in others {
|
||||||
|
other.forceTerminate()
|
||||||
|
}
|
||||||
|
}
|
||||||
HotkeyManager.shared.onTrigger = { CaptureController.shared.begin() }
|
HotkeyManager.shared.onTrigger = { CaptureController.shared.begin() }
|
||||||
HotkeyManager.shared.register()
|
HotkeyManager.shared.register()
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -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.4</string>
|
<string>1.6.5</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>64</string>
|
<string>65</string>
|
||||||
<key>LSUIElement</key>
|
<key>LSUIElement</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user