fix: preserve layout identity and apply portals across display changes - #8
Merged
Merged
Conversation
Owner
|
Thanks @JaeHyeon-KAIST for the fixes and regression coverage! We tested a real monitor disconnect/reconnect locally and confirmed that the saved portals restore correctly with the main window closed. Merged! We'll address the legacy Settings upgrade-compatibility edge case and the relative output-path check in the local packaging script in follow-up changes before the next release. |
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.
Summary
Fix two layout/portal issues affecting multi-monitor setups, including operation with the main window closed.
1. Preserve matched layout identity after pruning
The matching path previously retained an array index across
pruneLayouts. Removing an earlier unused layout could either cause an out-of-bounds crash or return a different retained layout. Resolve the result by its stable ID after pruning, while preserving the existing cleanup policy.2. Apply saved portals when the display configuration changes
Move display-change coordination to an app-lifetime
DisplayConfigurationCoordinator:Route Settings portal deletion/toggling through the current saved layout so changes survive configuration switches and reloads. Remove the unused reverse synchronization path. Preserve existing window-snapshot protection, migrate legacy portal lines using saved display snapshots, and retain a one-time local backup of previous global portal data before authoritative layout application.
Supporting changes
docs/.Validation
swift test: 181 tests passed, 0 failures (2026-09-09).swift build -c release: passed.git diff --check origin/main...HEAD: passed.The short background resource observation is only a baseline, not evidence of long-term stability. Regression tests use injected display providers and isolated preferences without starting global input taps.
Scope
This does not change portal crossing algorithms, layout retention policy, window-restoration behavior, or the separate shortcut-reset/global-enable persistence issues.