Skip to content
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

fix(menus): macOS Services menu not working, closes #243 #569

Merged
merged 2 commits into from
Sep 25, 2022

Conversation

caesar
Copy link
Contributor

@caesar caesar commented Sep 24, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

closes #243

@caesar caesar requested a review from a team as a code owner September 24, 2022 23:54
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing changefile

@caesar
Copy link
Contributor Author

caesar commented Sep 25, 2022

missing changefile

Wait, there are changefiles now? Nice!

@caesar caesar requested a review from amrbashir September 25, 2022 17:31
@amrbashir amrbashir merged commit d343abf into tauri-apps:dev Sep 25, 2022
@amrbashir
Copy link
Member

thank you

@github-actions github-actions bot mentioned this pull request Sep 25, 2022
@caesar caesar deleted the menus/services branch September 25, 2022 19:17
@wanghui2021
Copy link

image

Is this divider redundant?

Copy link
Contributor Author

@caesar caesar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this divider redundant?

It is indeed redundant. When I implemented this I wasn't sure how to solve it, but I have since found the solution, which is simply to change NSMenu::alloc(nil) to NSMenu::new(nil) as shown in the code review below.

@@ -308,10 +308,12 @@ impl Menu {
)),
MenuItem::Services => unsafe {
let item = make_menu_item("Services", None, None, MenuType::MenuBar);
// we have to assign an empty menu as the app's services menu, and macOS will populate it
let services_menu = NSMenu::alloc(nil).autorelease();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let services_menu = NSMenu::alloc(nil).autorelease();
let services_menu = NSMenu::new(nil).autorelease();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when will this be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Services menu item not working
3 participants