Merge pull request #4480 from apoco/single-instance-clarification

makeSingleInstance clarification
This commit is contained in:
Cheng Zhao 2016-02-16 20:17:18 +08:00
commit 25ac6f0f37

View file

@ -398,7 +398,7 @@ quit.
On OS X the system enforces single instance automatically when users try to open On OS X 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` a second instance of your app in Finder, and the `open-file` and `open-url`
events will be emitted for that. However when users start your app in command events will be emitted for that. However when users start your app in command
line the system's single instance machanism will be bypassed and you have to line the system's single instance mechanism will be bypassed and you have to
use this method to ensure single instance. use this method to ensure single instance.
An example of activating the window of primary instance when a second instance An example of activating the window of primary instance when a second instance
@ -413,7 +413,6 @@ var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory)
if (myWindow.isMinimized()) myWindow.restore(); if (myWindow.isMinimized()) myWindow.restore();
myWindow.focus(); myWindow.focus();
} }
return true;
}); });
if (shouldQuit) { if (shouldQuit) {