Repository navigation
fix(window): 修复 Windows 全屏、窗口切换及 Win10 边角显示 - #1708
xuesecanmeng wants to merge 10 commits into
Conversation
Keep Windows main windows opaque with their thick frame so Chromium owns fullscreen and maximized restore without a transient normal-size window. Publish settled native state to keep titlebar controls and corners aligned. Restrict temporary recovery pinning to macOS, where its watchdog clears the pin, so Windows and Linux recovery cannot leave the app above other windows. Cover the transitions with regression tests and synchronized specs.
Client-sized shape regions use the outer HWND origin and expose the left frame while truncating content. Keep Windows 10 unclipped so native resize targets and fullscreen restore remain intact. Retain Windows 11 DWM corners and theme radius acknowledgements, with regression coverage and native probes for the platform-specific policy.
Preserve the native maximize state and settle interval supplied by the previous integration merge so recovery tests exercise the upstream restore handler after rebasing onto the latest main.
Opaque thick-frame windows include invisible resize margins and a DWM-owned outline. Use physical monitor and visible window bounds so hidden taskbars and native borders do not produce false failures. Wait for foreground and native resize completion before sampling or restoring the cursor, and cover taskbar probe geometry with regressions.
The resolver uses native filesystem separators. Normalize the expected fixture path so the same contract is checked on Windows and POSIX hosts.
Client close completion can precede the server's socket close event. Observe delivery and connection removal with bounded polling so parallel validation does not depend on fixed 20 or 50 millisecond delays.
This test builds the complete sidecar and starts a real image worker. Give that integration path a bounded 30-second timeout under parallel transformation load while retaining every bundle and worker assertion.
Include the latest upstream changes before validating the native window fixes and submitting the pull request.
|
感谢补充 Windows 复现、探针和测试说明。我暂不合入,当前 diff 还有几个实质阻塞点:
Alt+Tab 和 Win10 圆角如能在当前版本稳定复现,可以分别带最小修复和对应验证回来。我核对后会继续 review。 |
Bring the current upstream main into the shared development branch while preserving the existing PR changes and commit history. Keep the review-driven scope reduction deferred so it can be reconsidered separately from this upstream synchronization.
Keep the Windows window-fix review focused by restoring the runtime package tests and plugin documentation to the merged main baseline. Retain window behavior, regression coverage, and related specifications.
|
感谢 review,补充说明 #1655 原修复、当前窗口方案及本次验证结果。
当前方案将 Windows 主窗口统一设置为 transparent: false、thickFrame: true,由 Electron/Chromium 的完整全屏流程管理显示器归属、窗口状态和恢复矩形。进入全屏时直接切换,不再手动取消最大化;退出时由原生流程恢复此前状态。应用延后读取并同步状态,仅对普通窗口执行必要的工作区适配,保留最大化窗口的原生恢复矩形。标题栏按钮也同时根据最大化和全屏状态更新。因此,额外全屏标记的移除,是配合底层全屏路径的切换。 Win10 改回原生直角,是因为旧圆角方案使用内容区尺寸生成 setShape() 区域,却从整个窗口的左上角裁剪;恢复厚边框后,内容区和窗口外框的偏移会造成边框露出、内容截断及边角不齐。直接裁到内容区又会移除原生边缘、角落的缩放区域。Win10 没有 Win11 的 DWM 原生圆角接口,因此当前移除自定义裁剪,优先保证内容完整、原生缩放和全屏恢复;Win11 继续使用 DWM 圆角。这里有明确的外观取舍:Win10 的主题圆角请求仍被接受,但窗口保持直角;alpha 背景色合成为不透明颜色。 我已在Win11双屏实机验证当前修复版本,窗口行为正常,未复现 #1655 中的跳屏、白屏问题,全屏切换及小窗尺寸恢复也正常。同时检查了窗口外观,在当前 Win11 环境中未复现 #1168 的三侧黑色边框问题。上述结果是本次环境下的实测结论,不扩展为所有系统、主题和缩放组合均已覆盖。 PR 已更新至 c55caac,包含 main 589e580。另外已撤回三个无关包的测试修改和六份插件文档的附带修改,差异从 51 个文件减至 42 个,保留窗口相关测试和必要说明。本地 37 项窗口测试、文档检查、类型检查、桌面及 Rust 发布构建、Windows 打包校验均已通过。 |
|
需要补充一个 review 结论:当前 head 改动了 另外,当前 diff 仍移除了 main 已有的 Win32 无边框全屏状态跟踪和进入全屏前取消最大化的保护,#1655 的双屏恢复路径仍有回归风险;请按最新 main 分别收窄并验证这些改动后再请求复审。感谢你补充 Windows 实机、探针和回归测试结果。 |
#1667 保留了无厚边框的全屏回退路径,通过进入全屏前取消最大化来规避 #1655。本 PR 则调整主窗口配置,采用 Electron/Chromium 的完整全屏流程,由其管理显示器归属、窗口状态和恢复矩形,从而替代原来的手动切换步骤,并解决这些步骤引入的闪烁和小窗尺寸恢复异常。 因此,这次是对窗口全屏实现路径的调整,而非单纯删除已有保护。当前PR中的变更是main合并了#1655 之后进行的,在 Win11 双屏实测未复现原问题,但窗口外观和主题兼容性的取舍仍需单独评估。 请确认“因此不符合只接收无界面改动 fix 的条件”具体含义,给我一个明确的PR接收范围,方便我对当前PR进行精简或者拆分。 |
修复 Windows 下 F11 全屏状态不同步、特定情况下 Alt+Tab 切换受置顶影响,以及 Win10 自定义圆角显示异常的问题。
问题与修复
setAlwaysOnTop(true)临时置顶,但负责在约 4 秒后解除置顶的定时检查仅在 macOS 启用;特定情况下 Windows 触发该路径后,会导致 PI-Desktop 持续置顶。验证结果
本轮原生测试环境为 Win11、175% 缩放;Win10 策略用例不等同于真实 Win10 系统验收。此前安装包已由提交者在 Win10 虚拟机中验证。
问题截图
展开查看 3 张问题截图
F11 全屏后拖动上边框,最大化按钮状态仍未更新
小窗进入 F11 全屏后,最大化按钮状态未变化
Win10 自定义圆角出现毛边