Open scottnonnenberg opened 6 years ago
I can reproduce this issue on Mac with nwjs-sdk-v0.27.2. Not reproduce on Linux/Windows.
This bug recently bit us.
nwjs-sdk-v0.35.5 - MacOS 10.13.6
Edit: More info....
We actually use the default menus, but we noticed that when this bug occurs, the hotkeys stop working for the actions in the App Menu. Like, Cmd-Q no longer works, AND it is actually missing from the menu. So, if you look at the menu, normally it will show the hotkeys in the menu, but after opening a new window, the hotkeys are missing from the menu, and they don't work anymore either.
This seems to be fixed with the NW2 renderer "chromium-args": "--enable-features=nw2"
on nwjs v0.42.3 Mac OS 10.14.6! 👍
To see, just add the line to package.json
in @scottnonnenberg 's demo.
If adding the mac built-in Edit or Window menus using menubar.createMacBuiltin
however, that call MUST PRECEDE any menubar.append()
calls or the menus get mixed up.
In index.html
menubar.createMacBuiltin("delete-later"); // must come first!!
menubar.append(new nw.MenuItem({ label: 'File', submenu: file }));
menubar.append(new nw.MenuItem({ label: 'View', submenu: view }));
It is still not fixed in nwjs v0.62.0
This is still an issue for me when I create the menubar BEFORE the window is shown. To reproduce:
Following this I get the default builtin menubar which persist also when closing the secondary window, preventing me from accessing the main window menubar.
If I switch steps 2 and 3 (showing the main window before creating my custom menubar) this issue doesn't happen.
NWJS Version: 0.45.6 OS: MacOS 10.12.6
This issue (+ workaround switching steps 2 and 3) still occurs with nwjs v0.62.0
on MacOS 11.6.4
This issue (+ workaround switching steps 2 and 3) still occurs with nwjs v0.82.0
on MacOS v12.7.1
NWJS Version :
0.27.1-sdk
Operating System : MacOS 10.11.6Expected behavior
I installed a new, custom menu. I expect that to remain even if I open a new window.
Actual behavior
If you set
window: { show: false }
in yourpackage.json
(so the window is responsible for showing itself after launch) then open a sub-window, the main global menu is reset to the default menu you get if you don't customize anything.How to reproduce
Open the attached archive, and run
nw .
in the same directory as thepackage.json
. Note the structure of the top-level menu. Then, click the link. Note that the top-level menu changes.Now, close the app. Change to
show: true
inpackage.json
and try it again. Note that the menu does not change this time.Archive.zip