mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-22 20:40:08 +00:00
fixed app not quitting completely on cmd-q
This commit is contained in:
parent
b84c41d668
commit
bcf09c59e3
@ -22,6 +22,7 @@ export class Application {
|
|||||||
private ptyManager = new PTYManager()
|
private ptyManager = new PTYManager()
|
||||||
private windows: Window[] = []
|
private windows: Window[] = []
|
||||||
private globalHotkey$ = new Subject<void>()
|
private globalHotkey$ = new Subject<void>()
|
||||||
|
private quitRequested = false
|
||||||
userPluginsPath: string
|
userPluginsPath: string
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
@ -82,6 +83,12 @@ export class Application {
|
|||||||
for (const flag of configData.flags || [['force_discrete_gpu', '0']]) {
|
for (const flag of configData.flags || [['force_discrete_gpu', '0']]) {
|
||||||
app.commandLine.appendSwitch(flag[0], flag[1])
|
app.commandLine.appendSwitch(flag[0], flag[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
if (this.quitRequested || process.platform !== 'darwin') {
|
||||||
|
app.quit()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
init (): void {
|
init (): void {
|
||||||
@ -226,7 +233,8 @@ export class Application {
|
|||||||
{
|
{
|
||||||
label: 'Quit',
|
label: 'Quit',
|
||||||
accelerator: 'Cmd+Q',
|
accelerator: 'Cmd+Q',
|
||||||
click () {
|
click: () => {
|
||||||
|
this.quitRequested = true
|
||||||
app.quit()
|
app.quit()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -26,12 +26,6 @@ app.on('activate', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
app.quit()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
process.on('uncaughtException' as any, err => {
|
process.on('uncaughtException' as any, err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
application.broadcast('uncaughtException', err)
|
application.broadcast('uncaughtException', err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user