mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Support minimize the main window after auto launch on Windows https://github.com/siyuan-note/siyuan/issues/11145
This commit is contained in:
parent
b6cae8cf8e
commit
b6eff31ba8
1 changed files with 4 additions and 2 deletions
|
|
@ -382,8 +382,8 @@ const initMainWindow = () => {
|
||||||
|
|
||||||
// 主界面事件监听
|
// 主界面事件监听
|
||||||
currentWindow.once("ready-to-show", () => {
|
currentWindow.once("ready-to-show", () => {
|
||||||
if (workspaces.length === 0 && openAsHidden) {
|
if (1 === workspaces.length && openAsHidden) {
|
||||||
bootWindow.minimize();
|
currentWindow.minimize();
|
||||||
} else {
|
} else {
|
||||||
currentWindow.show();
|
currentWindow.show();
|
||||||
if (windowState.isMaximized) {
|
if (windowState.isMaximized) {
|
||||||
|
|
@ -444,6 +444,7 @@ const showWindow = (wnd) => {
|
||||||
const initKernel = (workspace, port, lang) => {
|
const initKernel = (workspace, port, lang) => {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
bootWindow = new BrowserWindow({
|
bootWindow = new BrowserWindow({
|
||||||
|
show: false,
|
||||||
width: Math.floor(screen.getPrimaryDisplay().size.width / 2),
|
width: Math.floor(screen.getPrimaryDisplay().size.width / 2),
|
||||||
height: Math.floor(screen.getPrimaryDisplay().workAreaSize.height / 2),
|
height: Math.floor(screen.getPrimaryDisplay().workAreaSize.height / 2),
|
||||||
frame: false,
|
frame: false,
|
||||||
|
|
@ -640,6 +641,7 @@ for (let i = argStart; i < process.argv.length; i++) {
|
||||||
// 跳过内置参数
|
// 跳过内置参数
|
||||||
if (arg.startsWith("--openAsHidden")) {
|
if (arg.startsWith("--openAsHidden")) {
|
||||||
openAsHidden = true;
|
openAsHidden = true;
|
||||||
|
writeLog("open as hidden");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue