-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macos: add Window>Show UTM menu option #5908
Conversation
This reverts commit ab90be1.
92097e9
to
ef97098
Compare
@osy thanks for adding this to the next release! |
@@ -32,6 +32,9 @@ struct UTMApp: App { | |||
data.showErrorAlert(message: message) | |||
} | |||
} | |||
.onReceive(NSNotification.ShowMainWindow) { _ in | |||
NSApplication.shared.windows.first?.makeKeyAndOrderFront(nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is good enough. I might play around with it but thinking of capturing a reference in the AppDelegate in order to reference it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks!
I think that was the case on previous releases before the introduction of UTM Server in the Windows menu, see screenshot for reference: As the issue is gone now, closing the PR. |
Ah I see, that's a weird coincidence lol. |
As mentioned in issue #5898, I also noticed there is no way of getting only the virtual machine list window to open if:
Show UTM
from the menu)This PR adds the option in the Window Menu to show UTM, also adding the CMD + Alt + L keyboard shortcut to do so.
The main window is shown by sending a new notification, handled in the macOS
homeWindow
View. I am not sure whether this would be the best way of doing so with SwiftUI, so any suggestions are welcome! Thanks for the amazing app!