-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Cmd+Q, can not quit app #1416
Comments
Can reproduce in the template repo wails-vue3-tpl |
Did you bind it? |
not did, if i write code like this, myMenu := menu.NewMenuFromItems(
menu.SubMenu("File", menu.NewMenuFromItems(
menu.Text("&Open", keys.CmdOrCtrl("o"), openFile),
menu.Separator(),
menu.Text("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
runtime.Quit()
}),
)),
)
runtime.MenuSetApplicationMenu(myMenu) but |
On Mac, you have to do that yourself, it's not a systemwide feature. There's an edit menu role that you can use. |
in the source code pkg/options:Line 115 switch runtime.GOOS {
case "darwin":
if appoptions.Menu == nil {
appoptions.Menu = defaultMacMenu
}
} var defaultMacMenu = menu.NewMenuFromItems(
menu.AppMenu(),
menu.EditMenu(),
) if i set my custom enum, then must add myMenu := menu.NewMenuFromItems(
menu.SubMenu("File", menu.NewMenuFromItems(
menu.Separator(),
menu.Text("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
runtime.Quit(context.Background())
}),
)),
menu.EditMenu(),
) then, maybe, we should tips it in docs. |
Happy to accept a PR!!! |
PR @ pull/1423 |
Description
First, Thanks very much wails team,
I build my app with wails2, github url is EasyClash
When app is open, press
Cmd + Q
, can not quit app.To Reproduce
Cmd+Q
Expected behaviour
Quit App when press
Cmd+Q
Screenshots
No response
Attempted Fixes
No response
System Details
Additional context
No response
The text was updated successfully, but these errors were encountered: