Revert "Do not magically set --no-graphics when --vnc is passed (#763)

* Revert "Do not magically set `--no-graphics` when `--vnc` is passed (#732)"

This reverts commit a48f4d4ec9.

* Mark `--graphics` as private
This commit is contained in:
Fedor Korotkov 2024-03-19 04:28:27 -04:00 committed by GitHub
parent 7eac45702b
commit ae2d59e5c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -33,7 +33,7 @@ struct Run: AsyncParsableCommand {
))
var serialPath: String?
@Flag(help: ArgumentHelp("Force open a UI window, even when VNC is enabled.", visibility: .hidden))
@Flag(help: ArgumentHelp("Force open a UI window, even when VNC is enabled.", visibility: .private))
var graphics: Bool = false
@Flag(help: "Disable audio pass-through to host.")
@ -149,8 +149,8 @@ struct Run: AsyncParsableCommand {
throw ValidationError("--net-bridged, --net-softnet and --net-host are mutually exclusive")
}
if graphics {
print("--graphics is deprecated and will be removed in the future.\n")
if graphics && noGraphics {
throw ValidationError("--graphics and --no-graphics are mutually exclusive")
}
if (noGraphics || vnc || vncExperimental) && captureSystemKeys {
@ -349,7 +349,8 @@ struct Run: AsyncParsableCommand {
}
sigusr1Src.activate()
if noGraphics {
let useVNCWithoutGraphics = (vnc || vncExperimental) && !graphics
if noGraphics || useVNCWithoutGraphics {
// enter the main even loop, without bringing up any UI,
// and just wait for the VM to exit.
NSApplication.shared.run()