Skip to content

Every surface fitted to its view, each pump - #43

Merged
O6lvl4 merged 1 commit into
mainfrom
fit-surface-each-pump
Oct 19, 2026
Merged

O6lvl4 merged 1 commit into
mainfrom
fit-surface-each-pump

Conversation

@O6lvl4

@O6lvl4 O6lvl4 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

macOS changes a view's size without a Resized in more ways than can be listed: a window shown smaller than asked (#42 caught that one), full screen entered or left (Cmd+Enter in sprid), a move to another display. A surface left at the old size is pinned top-left and unscaled, so its top goes under the title bar (sprid's tab bar disappears) and its rows sit off from the pointer (a selection lands a bar's height from the drag).

Each pump now reads every window's view bounds in backing pixels and, where they differ from the surface, resizes it and reports a resize. The hidden-window check from #42 becomes a case of this.

SNAIDHM_TRACE_FIT=1 (or a file path) traces the sizes seen.

🤖 Generated with Claude Code

macOS changes a view's size without a `Resized` in more ways than can be
listed: a window shown smaller than asked (#42 caught that one, when the
window is shown), one fitted under the menu bar, full screen entered or
left, a move to another display. A surface left at the old size is pinned
to the top left and unscaled, so its top went under the title bar — a
terminal's tab bar out of sight — and its rows sat off from the pointer:
a selection landed a bar's height from where it was dragged. The program
could do nothing: `width` and `height` report the surface, and the size
reported only changed with the event that didn't come.

So no event is trusted: each pump reads every window's view bounds in
backing pixels (`convertRectToBacking:`, a rect in registers on arm64)
and, where they differ from the surface, resizes it and reports a resize.
The check made when a hidden window is shown is a case of this now.

SNAIDHM_TRACE_FIT=1 traces the sizes seen to stderr; a path appends to
that file, for an app opened from the Finder.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@O6lvl4
O6lvl4 merged commit 652cebb into main Oct 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant