Skip to content

Name spdisplays_display rows from their EDID and flag the ones with none - #129

Open
rodchristiansen wants to merge 2 commits into
mainfrom
fix/unresolved-display-names-workitem-3907
Open

rodchristiansen wants to merge 2 commits into
mainfrom
fix/unresolved-display-names-workitem-3907

Conversation

@rodchristiansen

@rodchristiansen rodchristiansen commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • New RegistryDisplay.resolveUnnamed(_:from:) in EDIDDisplay.swift, called from the hardware module right after the EDID serial join.
  • It picks out external rows that system_profiler named with the literal key spdisplays_display (or left empty), or whose vendor id is 756e6b6e (ASCII "unkn", meaning macOS read no EDID).
  • A row with a real vendor id joins its IO-registry EDID the same way enrich does: vendor, product and header serial, or a unique vendor and product. It takes the registry ProductName, or failing that the EDID name descriptor.
  • An unnamed row with no EDID takes the one attached registry EDID that no other row's model claims. This only happens when it is the only external row without an EDID, there is exactly one spare EDID, that EDID's link is not reported inactive, and the EDID carries a name. The row then picks up that EDID's vendor id, product id, serial, manufacturer code and connection.
  • Every unnamed row ends up with unidentified: true and the name Unidentified Display, or with its recovered name and unidentified: false. A flagged row never carries another display's serial.
  • A row system_profiler did name but read no EDID for, such as an AirPlay target, keeps its name and adopts nothing; it only gets unidentified: true. Rows with a real name and a real vendor id are unchanged and get no key.

Why

KVMs, adapters, virtual displays and AirPlay targets reach inventory named spdisplays_display, a localization key rather than a name. Consumers had to recognise that string to skip them. The explicit flag lets them skip these rows by rule.

Testing

  • swift test: all suites pass.
  • Seven new EDIDDisplayTests cases cover:
    • naming a real-vendor row from the joined EDID
    • an unknown-vendor row taking the only spare EDID
    • an unknown vendor with no EDID being flagged
    • refusing an EDID that another row claims, and refusing ambiguous pairings
    • a real vendor whose EDID carries no name being flagged
    • a named row with no EDID keeping its name and blocking the spare pairing
    • refusing a spare EDID whose link is inactive or which carries no name
  • I have not run this on a Mac that has an unresolved display attached.

Before merging

  • Consumers that skip unidentified displays by the spdisplays_display name should also honour unidentified. A real-vendor row that cannot be named is now called Unidentified Display, not the raw key, and the old name check misses it. Unknown-vendor rows keep vendor id 756e6b6e, so a vendor-id check still catches those.
  • Report attached monitors in peripherals displayDevices #127 moves this display block into buildDisplays. Whichever lands second needs a one-line rebase.

…ameless EDID #3907

A row system_profiler named but read no EDID for, such as an AirPlay target, now keeps its name and is only flagged unidentified. The spare EDID an unnamed row adopts must be on an active link and must carry a name, so a flagged row never holds another display's serial, and the one-row guard counts every external row without an EDID.
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.

1 participant