1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

Close immediately on windows

This commit is contained in:
Junyoung Choi
2018-02-04 00:59:54 +09:00
parent 8dd82e1a3b
commit 8e1bf48cd1

View File

@@ -40,20 +40,16 @@ mainWindow.webContents.sendInputEvent({
keyCode: '\u0008' keyCode: '\u0008'
}) })
if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon') { if (process.platform === 'darwin' || process.env.DESKTOP_SESSION === 'cinnamon') {
mainWindow.on('close', function (e) { mainWindow.on('close', function (e) {
e.preventDefault() e.preventDefault()
if (process.platform === 'win32') { if (mainWindow.isFullScreen()) {
quitApp() mainWindow.once('leave-full-screen', function () {
} else {
if (mainWindow.isFullScreen()) {
mainWindow.once('leave-full-screen', function () {
mainWindow.hide()
})
mainWindow.setFullScreen(false)
} else {
mainWindow.hide() mainWindow.hide()
} })
mainWindow.setFullScreen(false)
} else {
mainWindow.hide()
} }
}) })
@@ -66,9 +62,6 @@ if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon')
}) })
} }
mainWindow.on('resize', _.throttle(storeWindowSize, 500)) mainWindow.on('resize', _.throttle(storeWindowSize, 500))
function quitApp () {
app.quit()
}
function storeWindowSize () { function storeWindowSize () {
try { try {