Skip to content

The swiss army knife of lossless video/audio editing

fix broken requestSingleInstanceLock in MAS

Mikael Finstad6292f1c7f2fa
diff --git a/public/electron.js b/public/electron.js
index caca2eee..0d1c9af8 100644
--- a/public/electron.js
+++ b/public/electron.js
@@ -149,7 +149,12 @@ function parseCliArgs(rawArgv = process.argv) {
const argv = parseCliArgs();
-if (!argv.allowMultipleInstances && !app.requestSingleInstanceLock()) {
+function safeRequestSingleInstanceLock() {
+ if (process.mas) return true; // todo remove when fixed https://github.com/electron/electron/issues/35540
+ return app.requestSingleInstanceLock();
+}
+
+if (!argv.allowMultipleInstances && !safeRequestSingleInstanceLock()) {
app.quit();
} else {
// On macOS, the system enforces single instance automatically when users try to open a second instance of your app in Finder, and the open-file and open-url events will be emitted for that.