Window: get/set position and bounds (save & restore window placement) - #31
Open
codymullins wants to merge 1 commit into
Open
Window: get/set position and bounds (save & restore window placement)#31codymullins wants to merge 1 commit into
codymullins wants to merge 1 commit into
Conversation
A shell can now save the window placement on close and restore it on the next launch, and react when the user drags the window. - AppWindow.Position (get/set) is the top-left in logical screen points, matching the GLFW backend. AppWindow.Bounds adds the logical size. - AppWindow.Moved fires when the window moves. - GLFW backend uses IWindow.Position and the IWindow.Move event. - AppKit backend flips AppKit's bottom-left frame against the window's screen height, and raises Moved from windowDidMove. Closes #13
This was referenced Jun 16, 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.
Closes #13.
Browsers persist and restore window size and position across launches.
AppWindowcould set logical size (Resize) but couldn't read or set position, nor report user-initiated moves.What changed
AppWindow.Position(get/set) — the window's top-left in logical screen points, matching the GLFW backend's coordinate space.AppWindow.Bounds—Positionplus the logical size, as one rect.AppWindow.Moved— fires when the window moves.IWindow.Positionfor get/set and theIWindow.Moveevent forMoved.Skyline.Apple) — flips AppKit's bottom-left frame against the window's screen height so the reported origin is top-left like GLFW, and raisesMovedfromwindowDidMove:. Multi-monitor origin is best-effort against the window's current screen.Tests
Skyline.WindowedTests— sets and readsPositionon a real GLFW window and checksBoundsreports position plus logical size (covers the GLFW get/set path).Verification
dotnet build Skyline.slnxclean (0 warnings);Skyline.Applebuilds clean on the macos workload.format-check.shclean.GlfwWindowBackend100%;AppWindowrose to 97.1% (new position code covered). Overall 98% matchesmainon this machine — the remaining uncovered lines are the pre-existingAppWindow/AppHostwindowed-thread flakiness under coverlet, not from this change.Note
Independent of #5/#8, but this is the 3rd open PR touching
AppWindow.cs,GlfwWindowBackend.cs,IWindowBackend.cs, and the windowed harness. Whichever PRs merge after the first will need trivial conflict resolution (the edits are in different regions / are appends).