mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
fix quit bug on Ubuntu
This commit is contained in:
@@ -32,22 +32,24 @@ mainWindow.webContents.sendInputEvent({
|
|||||||
keyCode: '\u0008'
|
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()
|
app.quit()
|
||||||
return true
|
})
|
||||||
}
|
}
|
||||||
mainWindow.hide()
|
|
||||||
e.preventDefault()
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('activate', function () {
|
app.on('activate', function () {
|
||||||
if (mainWindow == null) return null
|
if (mainWindow == null) return null
|
||||||
mainWindow.show()
|
mainWindow.show()
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('before-quit', function (e) {
|
|
||||||
mainWindow.removeAllListeners()
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = mainWindow
|
module.exports = mainWindow
|
||||||
|
|||||||
Reference in New Issue
Block a user