Add Advanced Setting VM
Nucleic-Session: E3817761-E202-470E-8527-0BC3D40402B9 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -176,25 +176,6 @@ struct PaneledChatView: View {
|
||||
onDrop: { panels.drop($0, into: slot) })
|
||||
}
|
||||
|
||||
// MARK: - Guest display
|
||||
|
||||
/// While a chat is open, watch its macOS VM and — when the user has enabled "Always open VM guest
|
||||
/// display" — reveal the VM monitor as soon as the guest boots, whatever launched it (`mac_vm_exec`,
|
||||
/// `mac_vm_computer`, or provisioning). `revealVMMonitor()` is idempotent (a no-op once a monitor is
|
||||
/// placed, and the panel re-roots onto the open chat), so polling and re-revealing is safe; the loop
|
||||
/// re-reads the setting each tick so flipping it on takes effect without reopening the chat.
|
||||
private func watchGuestDisplay() async {
|
||||
guard store.macVMSupported, let session else { return }
|
||||
let vmName = MacVMManager.vmName(for: session.id)
|
||||
while !Task.isCancelled {
|
||||
if MacVMSettings.alwaysOpenGuestDisplay,
|
||||
await store.runningMacVMs().contains(where: { $0.name == vmName }) {
|
||||
panels.revealVMMonitor()
|
||||
}
|
||||
try? await Task.sleep(for: .seconds(2))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Sizing
|
||||
|
||||
private func widthRange(_ container: CGSize) -> ClosedRange<CGFloat> {
|
||||
|
||||
Reference in New Issue
Block a user