mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
fix quit bug on Ubuntu
This commit is contained in:
@@ -32,22 +32,24 @@ mainWindow.webContents.sendInputEvent({
|
||||
keyCode: '\u0008'
|
||||
})
|
||||
|
||||
mainWindow.on('close', function (e) {
|
||||
if (process.platform === 'linux' && process.env.DESKTOP_SESSION !== 'cinnamon') {
|
||||
if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon') {
|
||||
mainWindow.on('close', function (e) {
|
||||
mainWindow.hide()
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
app.on('before-quit', function (e) {
|
||||
mainWindow.removeAllListeners()
|
||||
})
|
||||
} else {
|
||||
app.on('window-all-closed', function () {
|
||||
app.quit()
|
||||
return true
|
||||
}
|
||||
mainWindow.hide()
|
||||
e.preventDefault()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
app.on('activate', function () {
|
||||
if (mainWindow == null) return null
|
||||
mainWindow.show()
|
||||
})
|
||||
|
||||
app.on('before-quit', function (e) {
|
||||
mainWindow.removeAllListeners()
|
||||
})
|
||||
|
||||
module.exports = mainWindow
|
||||
|
||||
Reference in New Issue
Block a user