You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent behavior between app.quit and un-closable BrowserWindow #5680
If you create a BrowserWindow and set BrowserWindowOptions.closable, calling app.quit does not close the application in OSX. AFAIK, it is expected that calling app.quit() closes the app irrespectively of how the windows are built.
The behavior is not observed in Windows, only OSX. To quit the app in OSX, you need go to the dock, right click on the app and select Quit twice.
app.quit() will try to close all browser windows before exiting. But since they aren't closable it can't quit. You can instead use app.exit(exitCode) to bypass the checks.
changed the title [-]app.quit does not close application in OSX when BrowserWindowOptions.closable is set to false.[/-][+]Inconsistent behavior between app.quit and un-closable BrowserWindow[/+]on May 25, 2016
@zcbenz I feel as though app.quit should be able to close un-closable windows. Or at least add a force parameter that ignore unclosable windows. Purely because if I call app.quit() as @djpereira said
it is expected that calling app.quit() closes the app irrespectively of how the windows are built.
Calling window.close() should obviously fail, but calling app.quit() I feel shouldn't care about "windows" per say, rather it is trying to terminate the app as a whole?
The behavior of app.quit() is to first close all windows and then try to quit, and it will be canceled when a window refuses to closed. It is a request to quit, for force quitting there is app.exit.
Does anyone know why the code below causes inconsistent behavior with quitting the app with cmd+q. Yet the app stays active when close buttons is pressed. But know users on OSX need to press cmd+q twice, the regular quite from the menu doesnt actually quit the app no more, it only closes the main window?
// Quit when all windows are closed.
app.on('window-all-closed', () => {
if (!(clipServer && clipServer.isRunInBackgroundEnabled())) {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit();
}
}
});
The main application menu has a quit command which now needs to be used twice due to this code??? This menu is added by default by electron
Activity
danhp commentedon May 24, 2016
app.quit()will try to close all browser windows before exiting. But since they aren't closable it can't quit. You can instead useapp.exit(exitCode)to bypass the checks.zcbenz commentedon May 25, 2016
I think there are two bugs here:
app.quitcan close a window that marked as not closable.app.quittwice can ignore the un-closable windows.[-]app.quit does not close application in OSX when BrowserWindowOptions.closable is set to false.[/-][+]Inconsistent behavior between app.quit and un-closable BrowserWindow[/+]MarshallOfSound commentedon May 25, 2016
@zcbenz I feel as though
app.quitshould be able to close un-closable windows. Or at least add a force parameter that ignore unclosable windows. Purely because if I callapp.quit()as @djpereira saidCalling
window.close()should obviously fail, but callingapp.quit()I feel shouldn't care about "windows" per say, rather it is trying to terminate the app as a whole?zcbenz commentedon May 25, 2016
The behavior of
app.quit()is to first close all windows and then try to quit, and it will be canceled when a window refuses to closed. It is a request to quit, for force quitting there isapp.exit.MarshallOfSound commentedon May 25, 2016
Wow, I must have the the
appdoc page so many times and never seen that.exit()method... I cry 😢schroef commentedon Dec 28, 2019
Does anyone know why the code below causes inconsistent behavior with quitting the app with cmd+q. Yet the app stays active when close buttons is pressed. But know users on OSX need to press cmd+q twice, the regular quite from the menu doesnt actually quit the app no more, it only closes the main window?
The main application menu has a quit command which now needs to be used twice due to this code??? This menu is added by default by electron