-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: macOS automatic help menu detection #14199
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
Open
probablykasper
wants to merge
2
commits into
tauri-apps:dev
Choose a base branch
from
probablykasper:fix/help-menu-mac
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"tauri": patch:bug | ||
"@tauri-apps/api": patch:bug | ||
--- | ||
|
||
Fix macOS help menu detection. If you have a submenu labeled "Help", macOS will automatically show the macOS help menu search box. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -824,12 +824,13 @@ fn set_as_help_menu_for_nsapp<R: Runtime>( | |||
webview: Webview<R>, | ||||
rid: ResourceId, | ||||
) -> crate::Result<()> { | ||||
#[cfg(target_os = "macos")] | ||||
{ | ||||
let resources_table = webview.resources_table(); | ||||
let submenu = resources_table.get::<Submenu<R>>(rid)?; | ||||
submenu.set_as_help_menu_for_nsapp()?; | ||||
} | ||||
// Broken: https://github.com/tauri-apps/muda/issues/263 | ||||
// #[cfg(target_os = "macos")] | ||||
// { | ||||
// let resources_table = webview.resources_table(); | ||||
// let submenu = resources_table.get::<Submenu<R>>(rid)?; | ||||
// submenu.set_as_help_menu_for_nsapp()?; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we're also calling it incorrectly here: tauri/crates/tauri/src/menu/plugin.rs Line 814 in 4188ffd
|
||||
// } | ||||
|
||||
let _ = rid; | ||||
let _ = webview; | ||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
On macOS the About stuff is already in the first menu item (the one with the appname as label)
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 didn't change anything there. I assume it's there kinda just to have something in there (looks weird otherwise)
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.
Oh nvm I'm stupid, I did change it. Well yeah, I think it's best to have something there
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.
Electron's default menubar has Electron's own links in there, that's an option
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 agree that it looks weird without anything (at least as far as i can remember, didn't see check for ages)
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.
It actually doesn't look that weird on macos 26 anymore with all that added padding. Can we perhaps still revert this part? I'm completely on board with the hotfix of the actual issue so i'd like to get it in asap but i think what we put into the help menu needs a bit more thinking since right now it's only added for visuals.
Actually not a fan of that at all since it basically forces everyone to create their own menu even if they want just the default (cause they actually don't want a menu at all in the context of windows/linux)