zhuhao_dev #278

Merged
zhuhao merged 2 commits from zhuhao_dev into main 2024-09-27 10:13:46 +08:00
2 changed files with 2 additions and 6 deletions
Showing only changes of commit 5c0cc9a91c - Show all commits

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win", "name": "aix-win",
"version": "2.1.1", "version": "2.1.3",
"description": "", "description": "",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "example.com", "author": "example.com",

View File

@ -135,7 +135,7 @@ function createMainWindow() {
} else { } else {
mainWindow.loadFile(join(__dirname, '../renderer/index.html')) mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
} }
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口 // mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见 // mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
// 第三步: 开启remote服务 // 第三步: 开启remote服务
@ -280,14 +280,10 @@ function handleAll() {
}) })
// 用于监听-状态管理变化-同步所有窗口 // 用于监听-状态管理变化-同步所有窗口
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => { ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
console.log('pinia-state-change-1', storeName, jsonStr)
for(const curWin of BrowserWindow.getAllWindows()){ for(const curWin of BrowserWindow.getAllWindows()){
const id = curWin.webContents.id const id = curWin.webContents.id
const bool = id !== e.sender.id && !curWin.isDestroyed() const bool = id !== e.sender.id && !curWin.isDestroyed()
if (id === e.sender.id) {
console.log('pinia-state-change-2', 'windows-send', curWin.type)
}
if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送 if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送
curWin.webContents.send('pinia-state-set', storeName, jsonStr) curWin.webContents.send('pinia-state-set', storeName, jsonStr)
} }