Repository navigation
fix(desktop): restore macOS window bounds after zoom - #2523
Conversation
|
Review: the reported maximized-frame restoration failure is reproduced on macOS, and removing the macOS |
Tioit-Wang
left a comment
There was a problem hiding this comment.
The latest reproduction adds a case not covered by the PR: after native fullscreen enter/exit, the window is no longer maximized and is resizable, but the renderer still has data-window-maximized=true, which leaves the caption region no-drag. Current main sends a maximize-state event on maximize/unmaximize, while the leave-full-screen handler only sends fullscreen state. Please add a regression test for this transition and resync the maximized marker after the native fullscreen transition if reproduced. The PR also needs refreshing against current main before landing.
|
This issue is fixed by merged PR #2561, which continues the original zoom/restore implementation and adds the reproduced fullscreen-exit maximize-state resync. Your original commit is preserved. The refreshed Windows CI and Electron checks passed; native macOS gesture E2E remains platform validation not run in this Windows environment. I am closing this superseded PR to avoid duplicate window fixes. |
概要
解决 macOS 上 PI-Desktop 窗口最大化后无法恢复原尺寸和位置的问题。
macOS 的原生 Zoom/Restore 和边缘拖动都会进入 Electron 的
will-resize。原保护逻辑在最大化后取消这个事件,也会取消恢复原尺寸所需的调整。因此即使isMaximized()已变为false,窗口也可能仍占满工作区。将边缘保护限定在 Windows。macOS 的边缘拖动和 Zoom/Restore 交给 AppKit,应用原有的标题栏双击恢复仍走原生窗口接口。
关联议题
Fixes #2520
验证
704×650无法恢复、尺寸停在1728×1030的故障。修复后不透明和半透明窗口都通过。node --test apps/desktop/test/window-native-behavior.test.mjs apps/desktop/test/maximized-window-chrome.test.mjs,14 项通过。(264, 95, 1200, 800)。test:e2e:window-controls在工作面板动画阶段发生 CDP 超时,未走到窗口恢复断言。6b8ff1e803b6,通过 PR 基线检查。