This commit is contained in:
Vanessa 2023-09-16 19:30:21 +08:00
parent 2b62c9612d
commit eca0196bea
3 changed files with 16 additions and 4 deletions

View file

@ -723,6 +723,12 @@ app.whenReady().then(() => {
win.webContents.userAgent = "SiYuan/" + appVer + " https://b3log.org/siyuan Electron " + win.webContents.userAgent;
win.webContents.session.setSpellCheckerLanguages(["en-US"]);
win.loadURL(data.url);
win.on("close", (event) => {
if (win && !win.isDestroyed()) {
win.webContents.send("siyuan-save-close");
}
event.preventDefault();
});
const targetScreen = screen.getDisplayNearestPoint(screen.getCursorScreenPoint());
if (mainScreen.id !== targetScreen.id) {
win.setBounds(targetScreen.workArea);