mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
This commit is contained in:
parent
91096274c7
commit
c8e64a8bbb
3 changed files with 27 additions and 8 deletions
|
|
@ -736,12 +736,15 @@ app.whenReady().then(() => {
|
|||
}
|
||||
});
|
||||
ipcMain.on("siyuan-openwindow", (event, data) => {
|
||||
const mainWindow = BrowserWindow.fromId(data.id);
|
||||
const mainBounds = mainWindow.getBounds();
|
||||
const mainScreen = screen.getDisplayNearestPoint({x: mainBounds.x, y: mainBounds.y});
|
||||
const win = new BrowserWindow({
|
||||
show: true,
|
||||
backgroundColor: "#FFF",
|
||||
trafficLightPosition: {x: 8, y: 13},
|
||||
width: screen.getPrimaryDisplay().size.width * 0.7,
|
||||
height: screen.getPrimaryDisplay().size.height * 0.9,
|
||||
width: mainScreen.size.width * 0.7,
|
||||
height: mainScreen.size.height * 0.9,
|
||||
minWidth: 493,
|
||||
minHeight: 376,
|
||||
fullscreenable: true,
|
||||
|
|
@ -755,7 +758,11 @@ app.whenReady().then(() => {
|
|||
webSecurity: false,
|
||||
},
|
||||
});
|
||||
win.loadURL(data);
|
||||
win.loadURL(data.url);
|
||||
const targetScreen = screen.getDisplayNearestPoint(screen.getCursorScreenPoint())
|
||||
if (mainScreen.id !== targetScreen.id) {
|
||||
win.setBounds(targetScreen.workArea)
|
||||
}
|
||||
require("@electron/remote/main").enable(win.webContents);
|
||||
});
|
||||
ipcMain.on("siyuan-open-workspace", (event, data) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue