mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2024-11-14 18:57:40 +01:00
fix: 🐛 MacOS reduced to the tray to evoke failure
This commit is contained in:
parent
bd36dd3336
commit
d7bf83b488
@ -94,25 +94,6 @@ function createWindow() {
|
||||
events(mainWindow)
|
||||
}
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
app.quit()
|
||||
mainWindow = null
|
||||
})
|
||||
|
||||
// 仅 macOS 有这个事件
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
|
||||
if (!app.dock.isVisible()) {
|
||||
app.dock.show()
|
||||
}
|
||||
|
||||
app.show()
|
||||
app.focus()
|
||||
})
|
||||
|
||||
app.whenReady().then(() => {
|
||||
electronApp.setAppUserModelId('com.viarotel.escrcpy')
|
||||
|
||||
@ -121,4 +102,20 @@ app.whenReady().then(() => {
|
||||
})
|
||||
|
||||
createWindow()
|
||||
|
||||
// macOS 中应用被激活
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
return
|
||||
}
|
||||
|
||||
app.dock.show()
|
||||
mainWindow.show()
|
||||
})
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
app.quit()
|
||||
mainWindow = null
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user