Repository navigation
fix(ui): macOS 窗口贴顶时消除顶部阴影空隙 - #7331
Open
Silent-xiaomiao wants to merge 1 commit into
Open
Silent-xiaomiao wants to merge 1 commit into
Silent-xiaomiao wants to merge 1 commit into
Conversation
Silent-xiaomiao
force-pushed
the
fix/macos-top-flush
branch
from
November 20, 2026 06:26
e4ce8d2 to
a19b526
Compare
This branch has not been deployed
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.
现象
macOS 上把窗口拖到屏幕顶部时,窗口内容与菜单栏之间仍有约 8px 的空隙,而且窗口无法再往上移动。

原因
自定义窗口阴影在四周预留了 8px(
Decorator.SHADOW_INSETS)。macOS 不允许普通窗口覆盖菜单栏,窗口框贴住菜单栏后,这 8px 的透明阴影区就露在顶部,看起来像"顶不上去"。修改
只在 macOS 上生效:
选择连续收缩而不是"到阈值再切换",是因为后者无论加不加动画,都会在跨过阈值的那一帧产生一个 8px 的位移,手感上像被吸住。
取舍
验证
macOS 26.x 手工验证:拖拽贴顶、离开顶部、最大化切换均正常。多显示器和全屏场景建议再确认。
如果维护者认为这个视觉问题不值得引入额外的窗口几何监听,我可以直接关掉这个 PR。