1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-23 05:03:36 +03:00

Added basic support for multiple windows in windows 10

This commit is contained in:
Austin Warren 2019-07-16 20:36:24 -07:00
parent 735fa76239
commit a735c910d5
4 changed files with 7 additions and 2 deletions

View File

@ -58,7 +58,7 @@ export class Application {
if (!this.hasWindows()) { if (!this.hasWindows()) {
await this.newWindow() await this.newWindow()
} }
this.windows[0].send(event, ...args) this.windows.filter(w => !w.isDestroyed())[0].send(event, ...args)
} }
enableTray () { enableTray () {

View File

@ -39,7 +39,6 @@ const argv = parseArgs(process.argv, process.cwd())
if (!app.requestSingleInstanceLock()) { if (!app.requestSingleInstanceLock()) {
app.quit() app.quit()
process.exit(0)
} }
if (argv.d) { if (argv.d) {

View File

@ -147,6 +147,10 @@ export class Window {
this.window.webContents.send(event, ...args) this.window.webContents.send(event, ...args)
} }
isDestroyed() {
return !this.window || this.window.isDestroyed();
}
private setupWindowManagement () { private setupWindowManagement () {
this.window.on('show', () => { this.window.on('show', () => {
this.visible.next(true) this.visible.next(true)

View File

@ -147,6 +147,8 @@ export class HostAppService {
this.cliPaste.next(text) this.cliPaste.next(text)
} else if (op === 'profile') { } else if (op === 'profile') {
this.cliOpenProfile.next(argv.profileName) this.cliOpenProfile.next(argv.profileName)
} else if (op === undefined) {
this.newWindow();
} else { } else {
this.secondInstance.next() this.secondInstance.next()
} }