fix(desktop): restore macOS fullscreen after showing window - #2600
fix(desktop): restore macOS fullscreen after showing window#2600tiammomo wants to merge 2 commits into
Conversation
Signed-off-by: tiammomo <pearfl@qq.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/bootstrap-electron.ts | 调整主窗口全屏恢复时序,提前安装全屏状态监听,并增加发送方绑定的查询和退出 IPC。 |
| apps/desktop/src/main/mainWindowFullscreenStartup.ts | 封装显示后恢复全屏、读取窗口全屏状态及向对应 renderer 广播状态的逻辑。 |
| apps/desktop/src/main/secondary-windows.ts | 为普通副窗口安装相同的窗口级全屏状态广播。 |
| apps/desktop/src/preload/preload.ts | 向 renderer 暴露退出当前窗口全屏的受限 IPC 方法。 |
| apps/desktop/src/renderer/components/layout/ChromeActions.tsx | 在 macOS 全屏状态下向菜单传入退出全屏操作。 |
| apps/desktop/src/renderer/components/title-bar/MenuButton.tsx | 按需渲染本地化的“退出全屏”菜单项。 |
| apps/desktop/src/main/tests/mainWindowFullscreenStartup.test.ts | 覆盖全屏恢复顺序、平台分支、窗口销毁保护及窗口级状态广播。 |
| apps/desktop/src/renderer/components/layout/tests/ChromeActions.fullscreen.test.tsx | 覆盖 macOS 全屏退出入口的显示条件与调用行为。 |
Sequence Diagram
sequenceDiagram
participant State as window-state
participant Main as Electron 主进程
participant Window as BrowserWindow
participant Renderer as Renderer
State-->>Main: 已保存的全屏状态
Window->>Main: ready-to-show
Main->>Window: show()
Main->>Window: setFullScreen(true)
Window->>Main: enter/leave-full-screen
Main->>Renderer: fullscreen-change
Renderer->>Main: window-exit-fullscreen
Main->>Window: 按发送方窗口退出全屏
Reviews (2): Last reviewed commit: "fix(desktop): scope fullscreen fallback ..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02296bf593
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: tiammomo <pearfl@qq.com>
|
The Windows 1/2 shard failed in |
|
命中 UI 路径(apps/desktop/src/renderer/components/layout/ChromeActions.tsx / apps/desktop/src/renderer/components/title-bar/MenuButton.tsx)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
|
这条 PR 给全屏状态加了菜单退出入口,已开维护者确认。同意请 Approve;要改请 Request Changes。讨论:#2734 |
|
@tiammomo 👋 这个 PR 目前与 请在本地 merge 最新的 |
|
@tiammomo 👋 这个 PR 现在在等维护者确认,确认之前流程不会合并它 —— 不是卡住了,也不是在等你再改一版(你推的改动流程都读到了,判的就是最新一版代码)。
这条是流程自动发的状态提醒(同一版代码只发一次),不用回复。 |
|
@tiammomo 👋 这个 PR 目前与 请在本地 merge 最新的 |
这次改了什么
摘要
Restore saved macOS fullscreen only after the main window is visible. Add a trusted in-app Exit Full Screen fallback.
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
Remote and mobile adaptation
UI 变化
macOS fullscreen adds an Exit Full Screen item to the existing application menu. No screenshot is available because macOS hardware was not used.
DESIGN.md§4 Buttons, §8 Desktop Window, and §15.15 titlebar hover-token discipline. The fallback reuses the existing menu and leaves ChromeActions geometry unchanged.怎么验证的
自动验证
手工验证
Not run.
未执行的验证
macOS 26/27, multi-display, notch-screen, Dock, and Space validation require physical macOS hardware.
风险
风险分类
影响与回滚
setFullScreen(true)while the window is hidden. Windows and Linux retain the state manager's existing behavior.提交前检查
git commit -s,见 DCO)