Skip to content

Improve main window position restoration after boot on the Desktop #11437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
HowcanoeWang opened this issue May 17, 2024 · 3 comments
Closed
3 tasks done
Assignees
Milestone

Comments

@HowcanoeWang
Copy link

HowcanoeWang commented May 17, 2024

win11上外接显示器热拔插后,思源UI出现在屏幕外面

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

不确定是windows系统的问题还是思源的UI位置记忆问题。

window11系统下,思源位于外接显示器上,直接把type-c连接的外接显示器拔掉,思源会留在主显示器的外面,重启无法恢复。

PS:启动页面能出现在主显示器上,笔记页面会跑到屏幕外面

查看Documents\SiYuan\conf\appearance\windowState.json内容为:

{"isMaximized":false,"fullscreen":false,"isDevToolsOpened":false,"x":1440,"y":0,"width":1152,"height":682}

怀疑和那个x坐标有关系,但修改后重启思源都会被改回来,对应工作空间的windowsState.json内容为{}

Expected result

启动时检测UI位置是否在可获取的屏幕内?

Screenshot or screen recording presentation

No response

Version environment

- Version: 3.0.14
- Operating System: Win11
- Browser (if used):

Log file

I 2024/05/17 10:44:24 runtime.go:74: kernel is booting:
    * ver [3.0.14]
    * arch [amd64]
    * os [Microsoft Windows 11 Home China]
    * pid [17624]
    * runtime mode [prod]
    * working directory [C:\Users\hwang\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Users\hwang\Documents\SiYuan]
I 2024/05/17 10:44:24 conf.go:124: loaded conf [C:\Users\hwang\Documents\SiYuan\conf\conf.json]
I 2024/05/17 10:44:24 runtime.go:123: use network proxy [system]
I 2024/05/17 10:44:25 serve.go:116: kernel [pid=17624] http server [127.0.0.1:51386] is booting
I 2024/05/17 10:44:25 pandoc.go:132: built-in pandoc [ver=3.1.1, bin=C:\Users\hwang\Documents\SiYuan\temp\pandoc\bin\pandoc.exe]
I 2024/05/17 10:44:25 conf.go:1093: pandoc initialized, set pandoc bin to [C:\Users\hwang\Documents\SiYuan\temp\pandoc\bin\pandoc.exe]
I 2024/05/17 10:44:25 sync.go:754: sync websocket connected
I 2024/05/17 10:44:25 sync.go:799: sync websocket message: &{0  map[cmd:kernels kernels:[map[hostname:NERV-Linux id:995310b os:linux repo:PRTS终端 ver:3.0.14] map[hostname:NERV-ASUS id:4417wfc os:windows repo:PRTS终端 ver:3.0.14]]]}
I 2024/05/17 10:44:25 sync.go:147: sync before boot
I 2024/05/17 10:44:26 ref.go:50: got local latest [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:26 repo.go:595: walk data [files=5088] cost [337.2419ms]
I 2024/05/17 10:44:26 ref.go:50: got local latest [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:26 serve.go:129: reverse proxy server [127.0.0.1:6806] is booting
I 2024/05/17 10:44:26 ref.go:50: got local latest [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:26 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/refs/latest]
I 2024/05/17 10:44:27 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/indexes/af79321cbaf8f6ad8c38538609493f14bb371e6a]
I 2024/05/17 10:44:27 sync.go:1581: got cloud latest [device=5878cff221574ea98571221c48844658/linux, id=af79321cbaf8f6ad8c38538609493f14bb371e6a, files=5088, size=364.09 MB, created=2024-05-17 10:44:27]
I 2024/05/17 10:44:27 repository.go:1217: boot get sync cloud files elapsed [1.50s]
I 2024/05/17 10:44:27 sync.go:799: sync websocket message: &{0  map[cmd:synced kernel:995310b synced:1.715910269103e+12]}
I 2024/05/17 10:44:27 blocktree.go:509: read block tree [21.42 MB] to [C:\Users\hwang\Documents\SiYuan\temp\blocktree], elapsed [0.10s]
I 2024/05/17 10:44:27 conf.go:848: database size [297.95 MB], tree/block count [1201/67468]
I 2024/05/17 10:44:27 working.go:192: kernel booted
I 2024/05/17 10:44:28 box.go:77: auto stat [trees=1201, blocks=67468, dataSize=369.76 MB, assetsSize=179.64 MB]
I 2024/05/17 10:44:28 disk.go:33: disk usage [total=1.03 TB, used=236.55 GB, free=785.85 GB]
I 2024/05/17 10:44:28 repository.go:1279: syncing data repo [device=0f60a505-2849-49a2-8007-85185ae1f882, kernel=4417wfc, provider=0, mode=a/false]
I 2024/05/17 10:44:28 ref.go:50: got local latest [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:29 repo.go:595: walk data [files=5088] cost [318.2479ms]
I 2024/05/17 10:44:29 ref.go:50: got local latest [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:30 siyuan.go:112: uploaded object [siyuan/1632747327919/repo/PRTS终端/lock-sync]
I 2024/05/17 10:44:30 ref.go:50: got local latest [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:30 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/refs/latest]
I 2024/05/17 10:44:30 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/indexes/af79321cbaf8f6ad8c38538609493f14bb371e6a]
I 2024/05/17 10:44:30 sync.go:1581: got cloud latest [device=5878cff221574ea98571221c48844658/linux, id=af79321cbaf8f6ad8c38538609493f14bb371e6a, files=5088, size=364.09 MB, created=2024-05-17 10:44:27]
I 2024/05/17 10:44:31 sync.go:221: got local latest [dea77d1bad89f68db8164c967addea554544656e] files [5088]
I 2024/05/17 10:44:31 sync.go:1454: got latest sync [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:31 sync.go:228: got latest sync [dea77d1bad89f68db8164c967addea554544656e] files [5088]
I 2024/05/17 10:44:31 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/refs/latest]
I 2024/05/17 10:44:31 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/indexes-v2.json]
I 2024/05/17 10:44:32 siyuan.go:112: uploaded object [siyuan/1632747327919/repo/PRTS终端/check/indexes/dc62f83e65e6b945521e2b80135aafa261cca234]
I 2024/05/17 10:44:32 sync.go:1172: uploaded index [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:32 siyuan.go:112: uploaded object [siyuan/1632747327919/repo/PRTS终端/refs/latest]
I 2024/05/17 10:44:33 siyuan.go:138: downloaded object [siyuan/1632747327919/repo/PRTS终端/refs/latest]
I 2024/05/17 10:44:33 sync.go:1382: updated latest sync [device=0f60a505-2849-49a2-8007-85185ae1f882/windows, id=dea77d1bad89f68db8164c967addea554544656e, files=5088, size=364.08 MB, created=2024-05-17 10:44:16]
I 2024/05/17 10:44:33 siyuan.go:173: removed object [siyuan/1632747327919/repo/PRTS终端/lock-sync]
I 2024/05/17 10:44:33 repository.go:1347: synced data repo [device=0f60a505-2849-49a2-8007-85185ae1f882, kernel=4417wfc, provider=0, mode=a/false, ufc=3, dfc=3, ucc=0, dcc=0, ub=113.42 kB, db=511.08 kB] in [4.62s], merge result [conflicts=0, upserts=0, removes=0]

I 2024/05/17 10:44:33 index_fix.go:54: start checking index...
I 2024/05/17 10:44:42 index_fix.go:75: finish checking index
I 2024/05/17 10:49:00 serve.go:208: serving [/] for user-agent [Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0]

More information

No response

88250 added a commit that referenced this issue May 17, 2024

Verified

This commit was signed with the committer’s verified signature.
bagder Daniel Stenberg
@88250 88250 changed the title win11上外接显示器热拔插后,思源UI出现在屏幕外面 Improve main window position restoration after boot on the Desktop May 17, 2024
@88250 88250 self-assigned this May 17, 2024
@88250 88250 added this to the 3.0.15 milestone May 17, 2024
@88250
Copy link
Member

88250 commented May 17, 2024

看一下 ~\.config\siyuan\windowState.json

@HowcanoeWang
Copy link
Author

也是 {"isMaximized":false,"fullscreen":false,"isDevToolsOpened":false,"x":1440,"y":0,"width":1152,"height":682}

但修改后确实可以改变UI的位置,期待后续优化判断

88250 added a commit that referenced this issue May 17, 2024

Verified

This commit was signed with the committer’s verified signature.
bagder Daniel Stenberg
@88250
Copy link
Member

88250 commented May 17, 2024

好的,稍后改进,等发新版本后请帮忙测试。

@88250 88250 closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants