Repository navigation
Fit a new snap into the space beside a recently snapped window - #1903
kiteretsu903 wants to merge 16 commits into
Conversation
7a59f42 to
95bbdbd
Compare
|
There's a flaw in my design of |
That makes sense to me. Let me know how I could help with the refactoring! |
|
Thanks for your understanding! I'm getting ready to wrap up some other app work and will rearchitect the |
|
Ok, at long last, I have updated the WindowManager and am ready to resume PR review. Let me know if/when you get a chance to revisit this. Thanks! |
|
@rxhanson that's awesome! congrats on great work. Will update these PRs later this week |
b06b066 to
17ea393
Compare
17ea393 to
97430a3
Compare
Allow a delegate to decline placement before committing action history. Include the achieved frame in the completion notification so Fit can record the final size of a snap that crosses displays.
Adds opt-in Fit remaining space under Adjacent Windows, off by default. When window A snaps left and ends up 60% wide, snapping window B to the right half fills the remaining 40%. It works along both axes, honors configured gaps, and shows a matching drag-to-snap preview while keeping explicit sizing, cycling, and cooperative resize rules intact.
A valid, unchanged reference window A remains eligible until the next window command consumes that opportunity. If A has been closed, minimized, hidden, moved, or resized before that command, B falls back to an ordinary snap with a matching preview.
Behavior
Why WindowManager and hooks change
Fit computation, preview adjustment, and session tracking stay inside the Fit module.
SnappedWindowFitProviderregisters inAppDelegateas an ordered peerWindowManagerDelegateProviderahead of cooperative resize and records actual reference frames from achieved-frame completion notifications.These three internal extension points in
WindowMoveHooksare integrated intoWindowManager's execution flow: history commits wait for placement admission, and placement notifications report actual settled coordinates. Because the contracts are lifecycle-level rather than Fit-specific, other internal Rectangle features can reuse the same boundaries:WindowManagerDelegate.acceptsPlacement(defaulttrue)WindowManagercommits Restore, cursor, action, or calculation-history state or supersedes pending work (placeruns too late to prevent history updates and is skipped for animated placements and cross-display retries). Fit declines no-room snaps so Window B's saved Restore frame stays intact.WindowActionCompletion(result, achievedFrame, identity)onwindowActionCompletedmoveDidSettleonly runs on same-display moves). Fit records window A's actual settled size across displays; the dependent #1907 also consumes it for pair discovery.WindowActionIdentityonExecutionParameters,WindowMoveRequest, andWindowActionCompletionFeedback on whether these boundaries sit in the right places in the
WindowManagerpipeline is very welcome.Verification
Review order
Review the Fit changes on top of #1904. Merge in order: #1904 → #1903 → #1907. If #1904 is squash-merged, replay this layer on the resulting
mainbefore merging it.Demo
06-fit-remaining-space.mp4