diff --git a/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift b/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift index 656e03c3a..516f0798d 100644 --- a/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift +++ b/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift @@ -403,7 +403,6 @@ extension VMDisplayQemuMetalWindowController { func windowDidEnterFullScreen(_ notification: Notification) { isFullScreen = true if isFullScreenAutoCapture { - captureMouseToolbarButton.state = .on captureMouse() } } @@ -411,11 +410,17 @@ extension VMDisplayQemuMetalWindowController { func windowDidExitFullScreen(_ notification: Notification) { isFullScreen = false if isFullScreenAutoCapture { - captureMouseToolbarButton.state = .off releaseMouse() } } + override func windowDidBecomeKey(_ notification: Notification) { + if isFullScreen && isFullScreenAutoCapture { + captureMouse() + } + super.windowDidBecomeKey(notification) + } + override func windowDidResignKey(_ notification: Notification) { releaseMouse() super.windowDidResignKey(notification)