Skip to content

Desktop: cycle through the Mac's displays with the Desktop button (#91) - #173

Open
addhumal wants to merge 1 commit into
Saffsanity:mainfrom
addhumal:desktop-displays
Open

addhumal wants to merge 1 commit into
Saffsanity:mainfrom
addhumal:desktop-displays

Conversation

@addhumal

Copy link
Copy Markdown

Closes #91.

What it does

Implements multi-display cycling on the Desktop button per Noah's design decision on #91:

  • With one display (or an older host): the button is the plain Desktop button ("Show the full Mac desktop"), unchanged.
  • With two or more displays: the button shows which display the Desktop is on (Desktop 1, Desktop 2, …). Tapping it while a window streams switches to the Desktop on that display; tapping it while the Desktop streams moves to the next display in order (DesktopDisplays.button, VoiceOver: "Built-in Retina Display (1 of 2), showing now. Tap for Studio Display.").
  • Wire (additive, Sources/StreamProtocol/Switcher.swift): WindowList gains optional displays: [DisplayInfo]? and desktopDisplay: UInt32? (matching Sill Viewer: a Mac controlling another Mac #66's DisplayInfo shape so the two do not conflict). A Desktop tap sends DesktopPick(display: id) on kind 6 (.selectSource), which encodes as {"desktop":{},"display":ID} — an older host decodes it as StreamSource.desktop while a host with Feature Request: Select which Mac display Desktop mode streams #91 switches WindowCatalog.display to that display and restarts the Desktop stream.
  • Host (WindowCatalog, StreamCoordinator): lists the Mac's non-virtual displays (!isSills, sorted with the main display first so Desktop 1 is always the main screen), broadcasts a fresh WindowList when displays or the active display change, and restarts the Desktop pipeline when a device cycles to another display.

Why

When a Mac has two or more monitors connected, WindowCatalog previously captured only the main display for the Desktop source, with no way for an iPhone or iPad to view or control the other monitors (#91, #139). Cycling on the existing Desktop button keeps the bar layout unchanged on one-display Macs while making every connected display reachable in one tap.

Checks

  • Tests/checks/compatibility: 110 checks (8 new for DisplayInfo, WindowList.displays and desktopDisplay round-trip, DesktopPick backward-compatible encoding with StreamSource.desktop, and DesktopDisplays.button across 0, 1 and 2 displays). 27 of 27 mutants caught (5 new). Updated the checks README.
  • Tests/checks/run-all.sh and swift build -c release pass with only the known warnings; the iOS app builds for the simulator.

…ty#91)

With two or more displays, WindowList carries displays (DisplayInfo, main display
first, Sill's virtual displays excluded) and desktopDisplay; the Desktop button
shows Desktop 1, Desktop 2, … and a tap while the Desktop streams moves to the next
display via DesktopPick (encoded as {"desktop":{},"display":ID} on kind 6 so older
hosts decode it as StreamSource.desktop). With one display, the button is the plain
Desktop button as today (compatibility: 110 checks, 27 of 27 mutants).
Saffsanity added a commit that referenced this pull request Oct 19, 2026
The plan's open pull requests gain #173 (the same issue built separately:
the pick beside the Desktop's object, the displays by ID, "Desktop 1" for
a label, a pick without a display keeping the last one), and rule 5 says
the displays are read again before a stopped capture's restart, as
7cc8bcc does; CLAUDE.md's entry says both and the merge of main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saffsanity added a commit that referenced this pull request Oct 20, 2026
…exactly

The plan's #173 section now says how the two differ (the pick's key beside
or inside the Desktop's object, "Desktop 2" against "1 of 2", a pick without
a display, a display gone, a pick during a restart, two quick taps), what
backs each, and which should land: this branch, which does what Noah decided
on #91 ("when there is another one it says so") and keeps devices from before
on the main display. Rule 3 says a pick that named no display keeps meaning
the main one through a change of the main display; the wire section says why
desktopDisplay sits beside the list rather than as a flag on each entry
(#66's shape). The checks README says which change brought the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Select which Mac display Desktop mode streams

1 participant