[1143] 启动页模式下跳过 resume() 的 chrome 重建#4016
Merged
Merged
Conversation
启动页 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_,退出启动页时统一补装
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)attach_view→resume()同步补建,无需新增 hook;lazy 模块有(:idle 5000)逐模块预热兜底Test plan
xmake b stem构建通过gf fmt --changed-since=main通过std-bench, Task 'resume'耗时显著下降,STARTUP 时间戳提前🤖 Generated with Claude Code