Repository navigation
fix(window): accept the one-pixel frame Windows adds to resized bounds - #726
Open
shunxinyi-ljs wants to merge 1 commit into
Open
shunxinyi-ljs wants to merge 1 commit into
shunxinyi-ljs wants to merge 1 commit into
Conversation
Chrome returns 900x701 for a 900x700 resize on Windows because the resize frame is added after the bounds are rounded. The exact-equality check turned every call into `window_resize_constrained`, so `bsk window resize` never succeeded even though the window did resize. Treat a one-DIP difference per axis as the size that took effect and keep reporting the bounds Chrome returned; a larger difference still fails.
shunxinyi-ljs
force-pushed
the
fix/window-resize-frame-rounding
branch
from
November 13, 2026 10:26
a2caa98 to
1001ea3
Compare
shunxinyi-ljs
marked this pull request as ready for review
November 13, 2026 10:34
This branch has not been deployed
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.
On Windows,
bsk window resizefails on every call: the outer bounds come back one DIP taller than requested (900x700 → 900x701), and the exact-equality check reports that aswindow_resize_constrained.Change.
handleWindowResizenow accepts reported bounds that differ from the request by the resize frame, and still fails when the difference is larger. The reply continues to return the bounds that took effect, so a caller that cares about the exact size reads the same numbers as before. The tolerance is one DIP per axis and lives in a named helper next to the existing zoom tolerance in the same file.Failing evidence. Before the change, ten requests on Windows (widths 800/900, heights 600/601/700/701/720) returned
protocol_error/window_resize_constrainedten times, always one DIP above the requested height:800x600 → 601,900x700 → 701,900x720 → 721. The window did resize each time; only the verdict was wrong.Verification.
window.test.ts(accepts outer bounds one frame pixel larger than requested) fails on unmodifiedwindow.tsand passes with the change. A guard case (still reports bounds that differ by more than the frame, 900x703 for 900x700) passes on both sides.window.test.tsandsession.test.ts: 78 passed.tsc --noEmitandbiome formatclean on the changed files.window_id,900x601,900x701,900x702.Behaviour change. A resize that lands within one DIP of the request is now a success that returns the effective bounds instead of a
protocol_error. A one-pixel difference can no longer be reported as a constraint; anything larger still is.Not in scope. Repeated resizes on an occluded window can still return
window_resize_viewport_unchangedwhen Chrome stops updating layout metrics. That behaviour predates this change and is unchanged.