mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
perf: 独立窗口未激活阅读逻辑
This commit is contained in:
parent
19604c46f0
commit
7bf5805714
28
electron/electron.js
vendored
28
electron/electron.js
vendored
@ -96,6 +96,14 @@ function createMainWindow() {
|
||||
}
|
||||
})
|
||||
|
||||
mainWindow.on('focus', () => {
|
||||
mainWindow.webContents.send("browserWindowFocus", {})
|
||||
})
|
||||
|
||||
mainWindow.on('blur', () => {
|
||||
mainWindow.webContents.send("browserWindowBlur", {})
|
||||
})
|
||||
|
||||
mainWindow.on('close', event => {
|
||||
if (!willQuitApp) {
|
||||
utils.onBeforeUnload(event, mainWindow).then(() => {
|
||||
@ -159,6 +167,14 @@ function createChildWindow(args) {
|
||||
}
|
||||
})
|
||||
|
||||
browser.on('focus', () => {
|
||||
browser.webContents.send("browserWindowFocus", {})
|
||||
})
|
||||
|
||||
browser.on('blur', () => {
|
||||
browser.webContents.send("browserWindowBlur", {})
|
||||
})
|
||||
|
||||
browser.on('close', event => {
|
||||
if (!willQuitApp) {
|
||||
utils.onBeforeUnload(event, browser).then(() => {
|
||||
@ -642,18 +658,6 @@ app.on("will-quit",function(){
|
||||
globalShortcut.unregisterAll();
|
||||
})
|
||||
|
||||
app.on('browser-window-blur', () => {
|
||||
if (mainWindow) {
|
||||
mainWindow.webContents.send("browserWindowBlur", {})
|
||||
}
|
||||
})
|
||||
|
||||
app.on('browser-window-focus', () => {
|
||||
if (mainWindow) {
|
||||
mainWindow.webContents.send("browserWindowFocus", {})
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* 设置菜单语言包
|
||||
* @param args {path}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user