Skip to content

Commit

Permalink
display(macOS): force resign key when showing error
Browse files Browse the repository at this point in the history
This should already happen but maybe sometime it does not?

Fixes #6352
  • Loading branch information
osy committed May 23, 2024
1 parent 1819196 commit 55fa8b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Platform/macOS/Display/VMDisplayWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class VMDisplayWindowController: NSWindowController, UTMVirtualMachineDelegate {

@MainActor
func showErrorAlert(_ message: String, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil) {
window?.resignKey()
let alert = NSAlert()
alert.alertStyle = .critical
alert.messageText = NSLocalizedString("Error", comment: "VMDisplayWindowController")
Expand All @@ -219,6 +220,7 @@ class VMDisplayWindowController: NSWindowController, UTMVirtualMachineDelegate {

@MainActor
func showConfirmAlert(_ message: String, confirmHandler handler: (() -> Void)? = nil) {
window?.resignKey()
let alert = NSAlert()
alert.alertStyle = .informational
alert.messageText = NSLocalizedString("Confirmation", comment: "VMDisplayWindowController")
Expand Down

0 comments on commit 55fa8b2

Please sign in to comment.