🐛 重启后窗口大小恢复默认问题 Fix https://github.com/siyuan-note/siyuan/issues/7755

This commit is contained in:
Liang Ding 2023-03-24 10:21:15 +08:00
parent 7e8c1b39d7
commit 555a9ba2ca
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -206,11 +206,13 @@ const boot = () => {
height: defaultHeight,
}, oldWindowState);
// writeLog("windowStat [width=" + windowState.width + ", height=" + windowState.height + "], default [width=" + defaultWidth + ", height=" + defaultHeight + "], workArea [width=" + workArea.width + ", height=" + workArea.height + "]");
let x = windowState.x;
let y = windowState.y;
if (workArea) {
// 窗口大小等同于或大于 workArea 时缩小会隐藏到左下角
if (windowState.width >= workArea.width || windowState.height >= workArea.height) {
// 窗口大于 workArea 时缩小会隐藏到左下角,这里使用最小值重置
if (windowState.width > workArea.width || windowState.height > workArea.height) { // 重启后窗口大小恢复默认问题 https://github.com/siyuan-note/siyuan/issues/7755
windowState.width = Math.min(defaultWidth, workArea.width);
windowState.height = Math.min(defaultHeight, workArea.height);
}