mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🚨
This commit is contained in:
parent
8db6015709
commit
358047dea0
6 changed files with 11 additions and 20 deletions
|
|
@ -236,17 +236,12 @@ const isOpenAsHidden = function () {
|
|||
};
|
||||
|
||||
const initMainWindow = () => {
|
||||
let windowStateInitialized = true;
|
||||
// 恢复主窗体状态
|
||||
let oldWindowState = {};
|
||||
try {
|
||||
oldWindowState = JSON.parse(fs.readFileSync(windowStatePath, "utf8"));
|
||||
if (!oldWindowState.x) {
|
||||
windowStateInitialized = false;
|
||||
}
|
||||
} catch (e) {
|
||||
fs.writeFileSync(windowStatePath, "{}");
|
||||
windowStateInitialized = false;
|
||||
}
|
||||
let defaultWidth;
|
||||
let defaultHeight;
|
||||
|
|
@ -270,7 +265,7 @@ const initMainWindow = () => {
|
|||
|
||||
writeLog("windowStat [x=" + windowState.x + ", y=" + windowState.y + ", width=" + windowState.width + ", height=" + windowState.height + "], default [width=" + defaultWidth + ", height=" + defaultHeight + "], workArea [width=" + workArea.width + ", height=" + workArea.height + "]");
|
||||
|
||||
let resetToCenter = false
|
||||
let resetToCenter = false;
|
||||
let x = windowState.x;
|
||||
let y = windowState.y;
|
||||
if (workArea) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue