mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
Close immediately on windows
This commit is contained in:
@@ -40,12 +40,9 @@ 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') {
|
|
||||||
quitApp()
|
|
||||||
} else {
|
|
||||||
if (mainWindow.isFullScreen()) {
|
if (mainWindow.isFullScreen()) {
|
||||||
mainWindow.once('leave-full-screen', function () {
|
mainWindow.once('leave-full-screen', function () {
|
||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
@@ -54,7 +51,6 @@ if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon')
|
|||||||
} else {
|
} else {
|
||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('before-quit', function (e) {
|
app.on('before-quit', function (e) {
|
||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user