From 2de39f79de58945bf9299e2eb3661caaaf3f208c Mon Sep 17 00:00:00 2001 From: Guoliang Chen Date: Wed, 16 Sep 2026 21:08:57 -0700 Subject: [PATCH] polish P1: "Encryption compatibility" picker in the Security pane Two radio buttons, PowerToys 0.100 and earlier (the default) or 0.101 and later, bound straight to MacCipherScheme. Not a draft like the key and the port: one click is already a whole change, with no half-typed state to protect. The note points at it as the fix for the menu's "wrong encryption compatibility setting". Co-Authored-By: Claude Opus 5 (1M context) --- .../MWBMac/SettingsWindow/SecurityPane.swift | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Sources/MWBMac/SettingsWindow/SecurityPane.swift b/Sources/MWBMac/SettingsWindow/SecurityPane.swift index 6f041ea..36fc7d3 100644 --- a/Sources/MWBMac/SettingsWindow/SecurityPane.swift +++ b/Sources/MWBMac/SettingsWindow/SecurityPane.swift @@ -1,5 +1,5 @@ -// The Security pane: the shared key every packet is encrypted with, and the port -// the matrix talks on. +// The Security pane: the shared key every packet is encrypted with, which of the +// two PowerToys stream layouts to speak, and the port the matrix talks on. // // "Encryption key" / "Security key" / "To set up, generate the key on one // machine, and enter it manually on other machines" / "New key" are the modern @@ -7,10 +7,12 @@ // `MouseWithoutBorders_SecurityKey.Description`); the grouped display form and // the 16-character minimum are `Encryption.cs:65-79, 209-242`. // -// Both fields are drafts: changing either tears down and rebuilds every +// The key and the port are drafts: changing either tears down and rebuilds every // connection, so they are saved together on a button press, which is what the // Windows form's single "&Apply" does ("Save changes and reconnect to the -// machines in the matrix", `frmMatrix.Designer.cs:440-441`). +// machines in the matrix", `frmMatrix.Designer.cs:440-441`). The encryption +// compatibility picker is not a draft — one click is already a whole, deliberate +// change, and there is no half-typed state to protect against. import Foundation import MWBCore @@ -48,6 +50,23 @@ struct SecurityPane: View { } } + SettingsSection( + "Encryption compatibility", + note: + "Mouse Without Borders changed how it sets up its encrypted streams in " + + "PowerToys 0.101. The two are not compatible and cannot be negotiated, so " + + "this has to match the PowerToys version on the other machines. If the " + + "menu says a machine has the wrong encryption compatibility setting, the " + + "security key is right and this is the switch to change." + ) { + Picker("Encryption compatibility", selection: model.binding(\.macCipherScheme)) { + Text("PowerToys 0.100 and earlier").tag(CipherScheme.legacy) + Text("PowerToys 0.101 and later").tag(CipherScheme.modern) + } + .pickerStyle(.radioGroup) + .labelsHidden() + } + SettingsSection( "Port", note: