-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Warn before quitting with ⌘Q #2321
Comments
@conath any idea how to do this? I know Chrome has something where you have to confirm Cmd+Q or hold it. EDIT: Seems like I have to replace the whole menu and re-create the other items. |
@osy It's actually Opera not Chrome. |
Chrome does have it, it's an option in the "Chrome" menu ("Warn Before Quitting"). |
Reading more on this, seems like Key Equivalent Handling (menu/button shortcuts) are always handled before the event is sent to the key window -> first responder -> my view. So Cmd+Q, Cmd+W, Cmd+N for example won't be seen by the app. The way around it is to use https://developer.apple.com/documentation/appkit/nsevent/1534971-addlocalmonitorforeventsmatching which will require a bit of refactoring on the current window controller. I'm thinking of the following rules:
|
Chrome has it too, and it's beyond annoying - but can be disable fortunately. It should just show a confirmation window with the option to not ask ever again, like literally every mac app. |
There's also this: https://commandqapp.com/ |
If mouse is captured, we always pass Cmd+Any to the Metal view. If mouse is not captured, we always warn for Cmd+Q. If mouse is not captured, Cmd+W is blocked if VM is busy, or a confirm will show if VM is running, or window will close if VM is stopped. Resolves #2321
Edge also has it, it seems like most chromium browsers do |
Describe the issue
I am running a macOS VM and I press the keyboard shortcut ⌘ Q to quit an application in the VM, or ⌘ W to close a window. However, the shortcut is not passed into the VM (even when the mouse is captured). Instead, UTM immediately exits. This is very annoying because you lose all unsaved data and pressing ⌘Q/W is extremely common for macOS users.
Configuration
Suggestion
When ⌘ Q/W is encountered while a VM is still running, an alert should appear with the option to pause the VM, Exit and Cancel (continuing to run the VM as if ⌘ Q/W wasn't pressed).
The text was updated successfully, but these errors were encountered: