Skip to content

fix(workspaceui): keep the window's own size, not its content's - #80

Merged
bketelsen merged 1 commit into
mainfrom
fix/workspaceui-keep-window-frame
Nov 25, 2026
Merged

bketelsen merged 1 commit into
mainfrom
fix/workspaceui-keep-window-frame

Conversation

@bketelsen

@bketelsen bketelsen commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

KeepWindow kept the content's size (cx.Env().Window()) and asked for it at the next start as the window's size (desktop.SetWindowFrame). Where a window has a frame of its own the two differ, so the window came back smaller at each start.

Seen on Windows (the Windows 11 VM, FrostMail's NSGo client on fixture mail, 2026-11-24): left 1000 by 640, the client's storage held 984 by 631, and after a restart the window was 984 by 631: 16 narrower and 9 shorter. The same code was in FrostMail and Frostnotes before the kit took it in workspaceui/v0.5.0, so this is not new with the kit.

The fix: keep the size the platform reports for the window (desktop.Frame, which NSGo documents "as SetWindowFrame … take them"), and the content's only where it reports none. The least size is still checked on the content, which is what an app's window constraints are in.

Seen with the fix, same VM and client, built against this branch: left 1040 by 660 at 80, 30, the storage held 1040 by 660 at 80, 30, and after a restart the window was 1040 by 660 at 80, 30.

After this merges, the kit needs workspaceui/v0.5.1 (make bump-workspaceui VERSION=workspaceui/v0.5.1), and the apps take it.

Risk tier

Risk tier: 2 — a fix of behaviour in the kit. No path of .github/risk-paths.json is touched.

Docs housekeeping

  • The spec's row for KeepWindow and its rule

Verification

  • make verify: exit 0
  • Revert test: TestKeepWindowKeepsTheWindowsOwnSize fails without the fix ("kept {Width:1001 Height:700 …}, want the window's frame {Width:1016 Height:709 …}"); command: cd workspaceui && go test -run TestKeepWindowKeepsTheWindowsOwnSize .
  • On Windows, by hand, as above
  • In a real GTK 4 window on Xvfb's X11, against this branch: FrostMail's TestWindowAndViewAreKept and TestKeptWindowShowsAtStart pass
  • Not tested: macOS; a maximized window

KeepWindow kept the content's size and asked for it at a start as the
window's. On Windows, where a window has a frame of its own, each
start's window came back 16 narrower and 9 shorter. It now keeps the
size the platform reports for the window, and the content's only where
none is reported.
@github-actions github-actions Bot added the level:L3 Skim label Nov 25, 2026
@bketelsen
bketelsen merged commit 67cff5d into main Nov 25, 2026
10 checks passed
@bketelsen
bketelsen deleted the fix/workspaceui-keep-window-frame branch November 25, 2026 04:34
bketelsen added a commit to frostyard/frostmail that referenced this pull request Nov 25, 2026
The kit's v0.5.1 keeps the window's own size, not its content's
(frostyard/frostui#80): on Windows the kept window came back 16 narrower
and 9 shorter at each start. Plan 0017 records what was seen with it.
bketelsen added a commit to frostyard/frostnotes that referenced this pull request Nov 25, 2026
The kit's v0.5.1 keeps the window's own size, not its content's
(frostyard/frostui#80).
bketelsen added a commit to frostyard/frostmail that referenced this pull request Nov 25, 2026
The kit's v0.5.1 keeps the window's own size, not its content's
(frostyard/frostui#80): on Windows the kept window came back 16 narrower
and 9 shorter at each start. Plan 0017 records what was seen with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants