Repository navigation
Every surface fitted to its view, each pump - #43
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
macOS changes a view's size without a
Resizedin 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