Repository navigation
fix(floating): open new floating windows on the display in use - #297
Merged
Merged
Conversation
An app reopening a floating window where it last left it (Finder's Settings, a palette) now shows it on the display the user works on. Discovery places a floating window the app in use just opened on the active monitor, a lone palette stays with its document, and the daemon rebases its frame once and accepts the size the app gives it after the move, so no frame write repeats. Fixes #278
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — New floating windows follow the display in use while preserving explicit rules, owner placement, and restoration safeguards. The impact is limited to recoverable window placement and sizing, with regression tests and a reported two-display exercise. Notes:
You can add or adjust custom eligibility rules. Learn more. |
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.
Fixes #278
Summary
A floating window the app in use opens now appears on the focused monitor instead of where the app last left it (Finder's Settings after Command-comma, a palette, an inspector).
reconcileWindows(activeMonitorID:) discoverWindow monitor = transient owner ?? rule location / rule monitor + ?? active monitor # floating, app in use, opened now, app reaches that monitor ?? observed monitor Daemon.synchronizeDesktop - rebase floating frame only when a rule moved it + rebase floating frame when a rule or the active monitor moved it updateFloatingWindowFrames + once the move lands, accept the app's size (Finder grows Settings by 3 pt after the move)latestWindowIDwatermark (persisted with the topology), so windows already open at startup, after a restart, or returning from minimize or hide stay where they are.AXFloatingWindowpalette stays put, so it never shows before its document and then follows it back.Out of scope: the window still shows briefly on its old display (about 250 ms in the VM) before the move. That time is the app's Accessibility latency: Finder exposes the window about 160–220 ms after WindowServer draws it, and an earlier read sees nothing (measured in the VM).
Evidence
main, in the two-displaydefi-e2eVM, Command-comma with focus on display 2 opens Finder Settings on display 1. The new tests fail onmain:WindowLifecycleTests"Only a floating window the app in use opens appears on the active monitor"DaemonDesktopSynchronizationTests.newFloatingWindowOpensOnTheActiveDisplay, whose last step (the app grows the window after the move) also caught a resubmit loop: 16 frame writes every 250 ms.make verifypasses.Proved with the failing-then-passing unit tests and a recorded before/after run of the real daemon in the two-display VM.
Merge Danger
Door: two-way
Blast Radius: floating-window placement
Only new floating windows of the frontmost app on a multi-display desk are affected. A wrong guess places a floating window on the other display, and the user can move it back. The
latestWindowIDkey is optional in the stored topology, so older stores decode.Reviewed with review-loop: 1 round with Claude Opus 5.5. Verdict: approved
Note
Fix floating-window placement to use the active monitor
applicationReacheshelper). The active monitor is skipped when it holds a native-fullscreen window.Daemon.displayMovedFloatingWindowIDsset. Once a moved window lands within 2 points of its target,Daemon.updateFloatingWindowFramesadopts the app-reported frame (including its size) and clears the marker.RuntimeStateandWorkspaceTopologynow carrylatestWindowIDso reconciliation can tell newly discovered windows from previously observed ones. Config docs in CONFIGURATION.md describe the new behavior.AXFloatingWindowsubrole and no app siblings never use active-monitor placement.Macroscope summarized aea72ad.