Skip to content

[1143] 启动页模式下跳过 resume() 的 chrome 重建#4016

Merged
da-liii merged 7 commits into
mainfrom
da/1143/defer_startup_resume
Jul 19, 2026
Merged

[1143] 启动页模式下跳过 resume() 的 chrome 重建#4016
da-liii merged 7 commits into
mainfrom
da/1143/defer_startup_resume

Conversation

@da-liii

@da-liii da-liii commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • resume() 照搬 update_menus() 已有的 is_startup_tab_buffer 守卫:启动页 buffer 跳过 menu_main/menu_icons 0-3/notification_bar/side_tools 的 scheme 重建(每次构建入口都会先 lazy-initialize-force,是 OPEN → STARTUP 主要开销),仅保留 tab 栏(menu_icons 4)
  • chrome 由用户首次打开真实文档时的 attach_viewresume() 同步补建,无需新增 hook;lazy 模块有 (:idle 5000) 逐模块预热兜底
  • devel/1143.md 补充完整代码路径、resume() 明细与三次实测耗时对比

Test plan

  • xmake b stem 构建通过
  • gf fmt --changed-since=main 通过
  • 启动验证:std-bench, Task 'resume' 耗时显著下降,STARTUP 时间戳提前
  • 启动页显示正常(tab 栏有「启动页」tab)
  • 新建/打开文档后菜单栏、工具栏完整可用;切回启动页再切回无丢失

🤖 Generated with Claude Code

da-liii added 7 commits July 19, 2026 15:36
启动页 buffer 的菜单/工具栏全部不可见,但 resume() 仍无条件经 scheme 重建
menu_main/menu_icons/notification_bar/side_tools,且每个菜单构建入口都会先
lazy-initialize-force 强制导入所有 lazy 模块,是启动 OPEN → STARTUP 阶段的
主要开销。照搬 update_menus() 已有的 is_startup_tab_buffer 守卫:启动页仅
保留 tab 栏(menu_icons 4),其余 chrome 由首个真实文档的 resume 同步补建
启动页期间到达 Qt 侧的菜单写入原先被直接丢弃,但 tm_window 的
menu_current 缓存认为已安装,静态菜单(texmacs-menu)之后不再重发,
导致 resume 守卫落地后新建标签页时菜单栏永久缺失(mode/focus 工具栏
的 slot 无守卫所以正常)。改为启动页期间先存后装:写入时缓存 widget 并
置 startupChromePending_,退出启动页时统一补装
@da-liii
da-liii merged commit 1dc600f into main Jul 19, 2026
6 checks passed
@da-liii
da-liii deleted the da/1143/defer_startup_resume branch July 19, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant