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

[MacOS] Menu example does not show menus #1534

Open
mikeylemmon opened this issue Nov 22, 2024 · 4 comments
Open

[MacOS] Menu example does not show menus #1534

mikeylemmon opened this issue Nov 22, 2024 · 4 comments

Comments

@mikeylemmon
Copy link

Specification

  • pywebview version: master branch (5.3.2+ [commit f19a758])
  • operating system: macOS 14.6.1 (Sonoma) [M1 Pro]
  • web renderer: Cocoa

Description

Menus don't currently seem to be working on MacOS — running the menu example results only in a "View" menu (shown below) regardless of what is passed to the menu argument:

image

This behavior is the same when bundled with py2app.

A tiny bit of digging reveals that the issue can be fixed by commenting out the self._clear_main_menu() call that was added to cocoa.py's first_show method in #1407, but I'm guessing that removing the call also re-introduce the "ever-growing main menu bug". @lanzz were custom menus working when you first implemented your fix for the menu bug?

Practicalities

  • YES I am willing to work on this issue myself.

  • NO I am not prepared to support this issue financially.

@lanzz
Copy link
Contributor

lanzz commented Nov 22, 2024

I haven't used custom menus myself, the growing main menu bug I encountered during running the tests for an unrelated change. Sounds like that whole reset menu logic there needs to be moved to the same location where the custom menu is applied.

@r0x0r
Copy link
Owner

r0x0r commented Nov 22, 2024

Yes, @mikeylemmon is correct that _clear_main_menu is the culprit. The menu logic needs to be refactored. Maybe window specific menu can be incorporated as part of this refactor as well

@r0x0r
Copy link
Owner

r0x0r commented Dec 10, 2024

I pushed a fix to master. Please test.

@mikeylemmon
Copy link
Author

I just tested it out and menus are working, thanks for the fix!

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

No branches or pull requests

3 participants