-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
[bug] MacOS menu doesn't change based on window #5768
Comments
Since the menu are global on macOS, it is expected that the menu won't change. I think the documentation is clear enough but if it is not, please go ahead and open a PR with a better documentation. |
I just came across a similar issue (probably the same root cause):
I made a repro here: https://github.com/matthme/menu-stuck-tauri-macos I don't think this behavior is documented at all and it is quite counterintuitive given that the |
Reopening because it's a really weird situation which needs some clarification (in the docs) or even better a change in behavior. |
Maybe the menu apis should be on the App|Handle on macos for v2 instead? A bit more annoying to use cross-platform wise but at least it's clear what's happening, and it would prevent that new windows would overwrite the menu without a way to go back. |
that's indeed the planned changes for v2 leveraging the new menu crate (muda). |
I think we can internally disable |
Or would it be possible to have a boolean property |
Sorry my wording was not very good above, but this is exactly what @matthme said! |
Oh, and it comes even worse. It seems that one can't even disable the menu for an external window on Linux (and probably also Windows but not tested): https://github.com/matthme/menu-stuck-tauri-macos/tree/inherit-menu
Both are not an option in my case so I have to go with the lesser evil of the two which I think is number 2 for me. Or I'll have to create a JS-based custom menu... I would at least want to be able to explicitly not show any menu at all on Linux/Windows for external windows. |
For people reading this and having a similar conflict between platforms: One may hardly believe it but I had a breakthrough in my Rust skills recently and discovered conditional compilation. So it's easily possible to have different menus on windows other than the main window be only applied to Linux/Windows by simply using platform-specific Rust code. |
Describe the bug
This might be a "works as intended" but it should be documented.
Basically, the menu stays with the value of the latest call to
.menu
and doesn't change based on the currently focused window. Meaning that you are kinda forced to use a single menu for the whole application.Reproduction
.menu
Expected behavior
Unsure what behaviour is expected on MacOS, it would be nice if it switched but worst case it should be documented.
Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: