Repository navigation
fix(window-state): stop macOS overlay windows changing size on every restore - #3416
Merged
lucasfernog merged 10 commits intoOct 18, 2026
Merged
Conversation
…y shrink and multi-monitor DPI scaling drift
…ng the title bar The 20-40px outer/inner heuristic also matched ordinary decorated windows, saving their outer size so they grew by the title bar height on every restore. Derive the title bar height from the content rect instead, in one helper shared by update_state, the Resized handler and the initial metadata.
State files written by earlier versions hold physical pixels, and logical coordinates are not one global space across monitors with different scale factors, so a position converted with one monitor's scale was restored on another. Converting with the window's scale at Moved time could also pick up a stale scale mid-drag, and an unavailable scale silently stored physical values as logical.
For a maximized window the monitor check tested x and y, which are the monitor's corner, while the window was then placed at prev_x and prev_y. A window maximized after leaving a now-disconnected monitor passed the check and was restored off-screen.
Restores each window three times, also with an overlay title bar, and checks the inner and outer size (or position) still match the first save, so drift between saving and restoring accumulates and fails the test.
0.3.0 returns a new-session response that WebdriverIO 10 rejects as not W3C, so every macOS e2e spec failed to create a session.
Contributor
Package Changes Through 798cc24There are 11 changes which include deep-link with patch, deep-link-js with patch, notification with minor, notification-js with minor, shell with minor, shell-js with minor, single-instance with patch, updater with patch, updater-js with patch, window-state with patch, window-state-js with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
lucasfernog
approved these changes
Oct 17, 2026
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 macOS,
set_sizesets the window's content rect, butinner_sizereports the webview's bounds. WithtitleBarStyle: Overlaythe two differ, so each restore changed the window's height by the title bar height.This PR saves the content-rect size on macOS:
outer_sizeminus the title bar height, which isinner_position.y - outer_position.y. That's exactly whatset_sizerestores, whatever the title bar style.Also, a maximized window is now checked against the monitors using the position it will actually be restored to (
prev_x/prev_y), not the monitor corner.