This commit is contained in:
yj 2024-10-12 16:19:53 +08:00
parent ad07bd753f
commit d1b58efc52
1 changed files with 7 additions and 1 deletions

View File

@ -322,6 +322,13 @@ app.on('ready', () => {
childWindow[config.key].show()
windowOperation(config)
})
child.webContents.on('before-input-event', (event, input) => {
// if (env === 'development') {
if (input.key === 'F12') {
child.webContents.openDevTools()
}
// }
});
});
// 关闭子窗口
ipcMain.handle('closeChildWindow', (event, key) => {
@ -418,7 +425,6 @@ function quitAndInstall() {
function windowOperation(config) {
const child = childWindow[config.key];
child.setResizable(false)
if (env === 'development') child.webContents.openDevTools();
if (config.key === 'shareScreenWindow') {
const display = screen.getDisplayMatching({ ...child.getBounds() });
const x = Math.round((display.workArea.width - child.getSize()[0]) / 2);