Repository navigation
fix(desktop): restore titlebar dragging for zoomed macOS windows - #2583
Merged
vastsa merged 4 commits intoNov 28, 2026
Merged
Conversation
Keep native caption hit regions active after Zoom so users can move the window within or across displays. Let AppKit apply the titlebar double-click preference and remove the renderer-only drag markers.
Linuxdazhao
marked this pull request as ready for review
November 25, 2026 08:36
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.
概要
Closes #2582
macOS 主窗口执行 Zoom 后,原有样式会把整个窗口切成
no-drag。拖动聊天顶栏空白处时,系统收不到标题栏拖动手势,用户只能先还原,再移动窗口。移除针对最大化状态的全局样式、专用的渲染层双击监听和它们使用的 CSS 标记。普通和缩放窗口共用现有的原生拖动区域,按钮继续保留自己的点击区域,标题栏双击遵循 macOS 系统设置。保留 #2561 对原生全屏切换后窗口状态广播的修复,并单独覆盖其事件、延时校正和清理。
验证
macOS 27.2.1 arm64,锁定 Electron 43.6.0。
回归测试在基线上失败,在候选代码上通过。使用编译后的样式重新检查了普通和 Zoom 两种状态。52 项相关测试通过;桌面构建、类型检查、样式检查和 PR 基线检查通过。
在候选提交
e7f6c0e6e上运行了两项 macOS Electron E2E:node scripts/e2e-window-native-behavior.mjs通过。透明和不透明窗口在 Zoom 后都报告可移动,执行还原后,原位置和尺寸均恢复。node scripts/e2e-window-controls.mjs通过。真实桌面窗口退出原生全屏后,渲染层收到明确的fullscreen === "false",主进程报告maximized === true。在此状态下脚本从可见顶栏找到原生拖动区域,工作面板按钮为no-drag,随后成功还原窗口。样式单测也覆盖了非会话页主标题栏和工作面板按钮。E2E-167 记录了同屏拖动、跨屏释放、按钮点击和系统双击的手动验收步骤。物理双屏拖放和系统双击手势尚未实测。