1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-13 10:58:00 +03:00

autofocus window

This commit is contained in:
Eugene Pankov 2022-05-28 13:15:13 +02:00
parent 8c4c07c39b
commit 524ccd06f3
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -39,6 +39,19 @@ loadConfig().then(configStore => {
application.handleSecondInstance(newArgv, cwd)
})
if (!app.requestSingleInstanceLock()) {
app.quit()
app.exit(0)
}
if (argv.d) {
electronDebug({
isEnabled: true,
showDevTools: true,
devToolsMode: 'undocked',
})
}
app.on('ready', async () => {
if (process.platform === 'darwin') {
app.dock.setMenu(Menu.buildFromTemplate([
@ -55,20 +68,8 @@ loadConfig().then(configStore => {
const window = await application.newWindow({ hidden: argv.hidden })
await window.ready
window.passCliArguments(process.argv, process.cwd(), false)
window.focus()
})
}).catch(err => {
dialog.showErrorBox('Could not read config', err.message)
})
if (!app.requestSingleInstanceLock()) {
app.quit()
app.exit(0)
}
if (argv.d) {
electronDebug({
isEnabled: true,
showDevTools: true,
devToolsMode: 'undocked',
})
}