Skip to content

Add opt-in connection switches to the display rows - #218

Merged
didriksg merged 2 commits into
mainfrom
feature/connection-switches
Oct 10, 2026
Merged

didriksg merged 2 commits into
mainfrom
feature/connection-switches

Conversation

@didriksg

Copy link
Copy Markdown
Owner

What & why

A new setting, Show Connection Switches (off by default, Apple Silicon only), puts a switch on each display row in the panel, where the chevron is, the way the Wi-Fi menu has one in its header. Turning it off disconnects the display through the same path as Disconnect Display. The display then stays in the list as a dimmed row with its switch off, after the connected displays, and turning it on reconnects it and switches the input back, as Reconnect does. The switch is hidden on the last screen. Asked for in #103 by @Ameer-Jamal and @istvanmate, and in #210 by @Blazetes.

The second commit runs disconnects and reconnects one at a time inside PhysicalDisplayToggleService. The last-screen guard ran before the DDC hold, so two disconnects started close together could both pass it and turn every screen off until the blackout rescue brought one back. crispctl already ran connection changes one at a time for this reason, the panel did not, and two switches next to each other make the race easy to hit. The rescue's own reconnect skips the queue. I found the race while reading the backend in #209 and #210.

How tested

  • make check.
  • DisplayConnectionQueueTests fails with the queue's wait taken out (both disconnects pass, no screen left) and passes with it.
  • Live on a MacBook with one external: switch off and on, the setting flipped with a display connected and with one disconnected, VoiceOver labels, and both switches pressed 2 ms apart. The second disconnect is refused, the log says disconnect refused: ... is the last active display, and the message shows under the row.
  • Real mouse clicks on both switches (off and on) on the desk: the display disconnects and reconnects, and the row does not expand.

Checklist

  • Builds locally
  • Added/updated Crisp/Resources/Localizable.xcstrings for any new user-facing strings
  • Screenshot or short clip for any UI change

A Settings switch, Show Connection Switches, off by default, puts a switch on each display row in the panel (#103). Turning it off disconnects the display through the same path as Disconnect Display. A disconnected display then shows as a dimmed row with its switch off, after the live displays, in place of its Reconnect row. The switch is hidden on Intel and on the last viewable screen, as the Disconnect row is.
The last-screen guard in disconnect() ran before the DDC hold, which can wait for seconds. Two disconnects started close together, such as two connection switches flipped quickly, both passed the guard and turned every screen off until the blackout rescue brought one back. crispctl already ran connection changes one at a time for this reason; the panel did not. Disconnects and the user's reconnects now go through one queue in the service, and the guard runs inside each turn, with the display ID looked up again by UUID. The blackout rescue's reconnect skips the queue, so it never waits behind a change stuck in the DDC hold.
@didriksg
didriksg merged commit 4dbb797 into main Oct 10, 2026
2 checks passed
@didriksg
didriksg deleted the feature/connection-switches branch October 10, 2026 23:18
@didriksg
didriksg restored the feature/connection-switches branch October 10, 2026 23:19
@didriksg
didriksg deleted the feature/connection-switches branch October 10, 2026 23:19
@Ameer-Jamal

Copy link
Copy Markdown

Thank you so much!! This is awesome

@istvanmate

Copy link
Copy Markdown

Thanks from my side as well. However I do have to ask, where do I find this setting? I searched everywhere, cannot find it... Using it on a hackintosh, not sure, if it makes a difference...

@didriksg

Copy link
Copy Markdown
Owner Author

Show Connection Switches is in Crisp's Settings from 1.7.1, but only on Apple Silicon Macs, and a Hackintosh runs on an Intel or AMD CPU. On Intel, macOS takes a disconnected display out of the layout but doesn't power the screen down, and some Macs wake to a black screen on every display while one is disconnected. So Crisp hides the switches and the Disconnect rows there.

@istvanmate

Copy link
Copy Markdown

I had no issues with Better Display, but I do confirm the black screen with Lights Out... Thank you for your reply.

@hackwaly

Copy link
Copy Markdown
image

Still no disconnect action there.

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.

4 participants