Skip to content

Commit

Permalink
display(macOS): fix saving dynamic resolution
Browse files Browse the repository at this point in the history
We saved the guest resolution but we restored it as a host view size so this
led to an incorrect second re-scaling causing incorrect resolution to be
restored.

Fixes #6854
Fixes #6864
  • Loading branch information
osy committed Dec 3, 2024
1 parent 8479919 commit 5bf27b8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,13 @@ extension VMDisplayQemuMetalWindowController {
if isFullScreenAutoCapture {
captureMouse()
}
saveDynamicResolution()
}

func windowDidExitFullScreen(_ notification: Notification) {
isFullScreen = false
if isFullScreenAutoCapture {
releaseMouse()
}
saveDynamicResolution()
}

func windowDidBecomeMain(_ notification: Notification) {
Expand Down Expand Up @@ -476,8 +474,8 @@ extension VMDisplayQemuMetalWindowController {
}
if resolution.isFullscreen && !isFullScreen {
window.toggleFullScreen(self)
} else if resolution.size != .zero {
_ = self.updateGuestResolution(for: window, frameSize: resolution.size)
} else if let vmDisplay = vmDisplay, resolution.size != .zero {
vmDisplay.requestResolution(CGRect(origin: .zero, size: resolution.size))
} else {
_ = self.updateGuestResolution(for: window, frameSize: window.frame.size)
}
Expand Down

0 comments on commit 5bf27b8

Please sign in to comment.