Skip to content

fix(macos): restore app chrome in fullscreen - #1031

Merged
Kuddev merged 5 commits into
Kuddev:mainfrom
Life-go-on:fix/macos-fullscreen-toolbar
Nov 21, 2026
Merged

Kuddev merged 5 commits into
Kuddev:mainfrom
Life-go-on:fix/macos-fullscreen-toolbar

Conversation

@Life-go-on

Copy link
Copy Markdown
Contributor

Advertising, commercial promotion, and traffic solicitation are prohibited in PRs
and Issues. Business requests must go through the email in the
contribution policy.
PRs or Issues containing unauthorized promotion will be closed directly.
严禁利用 PR 或 Issue 推广、引流,未经授权的推广将直接关闭;商业需求请通过贡献指南中的邮箱沟通,已获批准的赞助按批准范围处理。

Result / 用户结果

修复 macOS 原生全屏时,顶部持续出现灰色区域并遮挡 Pebrel 自绘标题栏控件的问题。

进入全屏后隐藏空的原生工具栏,让应用自己的标题栏控件和主题背景正常显示;
退出全屏后恢复原生工具栏。

Related issue: #1024

Design / 设计边界

  • Responsibility and affected modules:

    • pebrel_app/src/platform/window_chrome/macos.rs 管理 macOS 原生
      Unified toolbar 和全屏切换时的可见性。
    • pebrel_app/src/gpui_shell/workspace/window_titlebar.rs 扩展标题栏
      布局回归测试。
    • pebrel_app/Cargo.toml 启用已有的 objc2-foundation/NSNotification
      feature。
  • Why this belongs here; interfaces that remain unchanged:
    AppKit 的空 Unified toolbar 在全屏时由独立的原生窗口显示,单独恢复主窗口
    标题栏透明度不能消除遮挡。此改动在 macOS 平台适配层响应全屏通知:进入全屏后
    隐藏空工具栏并恢复主窗口标题栏透明度,退出全屏后恢复工具栏。

    保留 Pebrel 自绘标题栏行、现有主题颜色和原生窗口控件;不使用固定主题颜色、
    负边距或任意偏移,也不改变现有公开接口。

  • Dependency, data-format, threading, or lifetime changes :
    只启用现有 objc2-foundation 依赖的 NSNotification feature,不升级依赖版本。

    原生 toolbar 注册的通知按所属窗口过滤,并在主线程处理。AppKit 持有 toolbar;
    基于 selector 的通知观察者不会额外持有 toolbar。没有持久化格式或线程模型变更。

  • Compatibility and migration/fallback behavior:
    行为修改限定在 macOS 路径;Windows 和 Linux 路径不变。退出全屏后恢复普通窗口
    的原生工具栏,不需要配置迁移。

Evidence / 验证依据

实机反馈

image image

Required Review / 必须确认

  • I followed CONTRIBUTING.md, docs/architecture.md, and docs/project-constraints.md.
  • I split responsibilities, not arbitrary line ranges; no duplicate behavior authority was added.
  • python3 scripts/check_architecture.py --base 303a7f4e passes; budgets were not inflated to fit the change.
  • Tests cover success and failure; platform/feature coverage limitations are stated.
    • 原生全屏失败/取消路径和视觉回归尚未完整自动化覆盖。
  • New messages use typed i18n IDs and matching placeholders; untranslated content has an explicit fallback.
    • 不适用:本次没有新增 UI 文案。
  • Governance changes include a counterexample, corrected contract, tests, and a maintainer-reviewed decision.
    • 不适用:本次没有治理规则变更。

Checkboxes explain the review; they do not replace CI or maintainer approval.

@Life-go-on
Life-go-on requested a review from Kuddev as a code owner November 18, 2026 07:21

@Kuddev Kuddev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复核了 macOS 窗口对应的通知注册、全屏切换时的工具栏和标题栏,以及普通窗口恢复。同步到最新 main 后,三个文件的补丁与原生对照使用的修复一致。对照中旧版两次进入全屏都保留了空工具栏,候选版本两次都隐藏它并恢复标题栏透明度,退出后工具栏可见;窗口截图也证实顶部空带消失。已批准,等待当前提交的必需检查。macOS 原生对照

@Kuddev Kuddev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked the AppKit changes against the updated main branch. The patch is identical to the previously reviewed change. Two full-screen cycles on the 2.6.1-based build also confirmed that the native toolbar hides on entry and returns on exit. https://github.com/Kuddev/pebrel/actions/runs/44860884232

@Kuddev
Kuddev merged commit 9a6e19e into Kuddev:main Nov 21, 2026
16 checks passed
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.

2 participants