Skip to content

Commit

Permalink
display(apple): fix screenshot for apple display
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Dec 23, 2024
1 parent e443413 commit 6853b2c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ class VMDisplayAppleDisplayWindowController: VMDisplayAppleWindowController {
var appleView: VZVirtualMachineView! {
mainView as? VZVirtualMachineView
}


override var contentView: NSView? {
appleView
}

var supportsReconfiguration: Bool {
guard #available(macOS 14, *) else {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class VMDisplayAppleTerminalWindowController: VMDisplayAppleWindowController, VM
var terminalView: TerminalView! {
mainView as? TerminalView
}


override var contentView: NSView? {
terminalView
}

var serialConfig: UTMAppleConfigurationSerial! {
appleConfig.serials[index]
}
Expand Down
8 changes: 6 additions & 2 deletions Platform/macOS/Display/VMDisplayAppleWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import Foundation

class VMDisplayAppleWindowController: VMDisplayWindowController {
var mainView: NSView?


var contentView: NSView? {
nil
}

var isInstallSuccessful: Bool = false

var appleVM: UTMAppleVirtualMachine! {
Expand Down Expand Up @@ -402,7 +406,7 @@ extension VMDisplayAppleWindowController {

extension VMDisplayAppleWindowController: UTMScreenshotProvider {
var screenshot: UTMVirtualMachineScreenshot? {
if let image = mainView?.image() {
if let image = contentView?.image() {
return UTMVirtualMachineScreenshot(wrapping: image)
} else {
return nil
Expand Down

0 comments on commit 6853b2c

Please sign in to comment.