Repository navigation
Desktop displays: follow the streamed display, number displays left to right (Saffsanity/sill#91) - #2
Merged
addhumal merged 2 commits intoOct 22, 2026
Conversation
Saffsanity#91) Input, the pointer and the window list follow the display the running Desktop pipeline captures, not the catalog's pick, which moves at once; a pick of another display that lands mid-switch is no longer dropped as "already the Desktop". Displays are numbered main first, then left to right, not by display ID.
…displays (Saffsanity#91) --pick=desktop:ID@T sends DesktopPick's {"desktop":{},"display":ID}, and the window list line shows displays and desktopDisplay when a host lists them, so a pick that lands mid-switch can be checked against the host's "Streaming ... at W×H" line.
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.
This goes into Saffsanity#173's branch (
addhumal:desktop-displays), so it can land as part of Saffsanity#173 or be picked out of it. I tested on a MacBook Pro with three displays: its built-in screen (main) under two identical BenQ MA270U monitors.What breaks on Saffsanity#173 as it stands
A pick that lands mid-switch is dropped, but the host still says it was made.
pickDesktopmovescatalog.displayat once (WindowCatalog.swift:99). A pick that arrives during a switch is queued as.desktop(StreamCoordinator.swift:885), and select's defer then drops it becausepick != activeis false (1237). The stream stays on the old display. Meanwhile the window list (2339),currentSourceRect(1067) andpointerGeometry(1110) all readcatalog.display, so the device is told it has the new display, and input and the pointer map onto it. Taps land on a screen the device isn't showing, until the next restart jumps the stream there on its own.Reproduced on that Mac with the test client: start the Desktop on display 4, pick 2, then pick 1 50 ms later.
Streaming … atlines)desktopDisplay=1(the built-in screen)desktopDisplay=2while 2 streamed, then1It came out the same in 4 of 4 runs of each build.
The numbers follow display IDs, not positions.
realDisplayssorts by main, thendisplayID(WindowCatalog.swift:278). On that Mac the right-hand BenQ, which macOS names "BenQ MA270U (2)", is ID 2, so it becomes Desktop 2. The left-hand one, "(1)", is ID 4, so it becomes Desktop 3. Tapping steps right, then left. The host's list readdisplays=[1, 2, 4]; with this change it reads[1, 4, 2].The change
desktopStreamDisplay, the display the running Desktop pipeline captures. Input, the pointer and the list'sdesktopDisplayfollow that display, never a pick that is still on its way. Its frame comes from the catalog's display first, thenrealDisplays, so the Desktop still takes input once Host: virtual Desktop display fallback for headless Macs (#61) Saffsanity/sill#200 lets it stream Sill's virtual display on a Mac with no other display.DesktopDisplays.comesBeforeputs the main display first, then the rest left to right (top to bottom where two start at the same x), which is the arrangement System Settings › Displays shows. It takes plainx/y, so StreamProtocol stays free of CoreGraphics.sillclient.py --pick=desktop:ID@Tsends aDesktopPick, and the window list line printsdisplaysanddesktopDisplay, so this can be checked without a device.What this deliberately leaves alone: the iOS side of Saffsanity#173, the virtual display as a Desktop target (Noah's decision on Saffsanity#91 names it, and Saffsanity#173 leaves it out), and
preferMainDisplay. That property is now written but never read, and its comment ("the default path keepsdisplays.first") no longer holds. It belongs to Saffsanity#173's own cleanup.How it was tested
Tests/checks/run-all.shwith Desktop: cycle through the Mac's displays with the Desktop button (#91) Saffsanity/sill#173 and this merged onto currentmain: 46 of 46 checks pass.The two new
compatibilitycases use the real layout above ([1, 4, 2]) plus a stacked pair. Under Desktop: cycle through the Mac's displays with the Desktop button (#91) Saffsanity/sill#173's ID order the first reads[1, 2, 4]and fails. Both new mutants are caught (29 of 29).SillHostCoretype-checks, and the host was built and run against the three real displays for the repro above, with this exact command:One caveat about how I ran it: there was no Xcode 27 on that Mac, so I built the CLI host with
swiftcdirectly, and in that local build only I setadvertise: falseso it would listen on 127.0.0.1 alone. That edit is not in this PR. A stockSillHostadvertises a plain door, so run the repro on a network you trust, and use your own display IDs from thedisplays=line.Not exercised: the iOS app with this change (the button's labels are covered by the pure check only), and input actually landing on a real host, since
sillclientsends input only to a--synthetichost. The input claim rests oncurrentSourceRectreading the same display as the list'sdesktopDisplay, which the repro shows was wrong.