Electron 7.1.10, Windows 10
When my app enters full screen, I'm trying to turn off menu visibility and make it "autohide" so it can be accessed through the Alt-key. The code below does turn it off but does not enable the "reveal through Alt-key" behavior.
I've tried commenting out the mainindow.setMenuBarVisibility();
calls since maybe that is absolute: menu never to be shown, but then the menu still displays in full screen. I've also tried changing the order, so that I call mainindow.autohideMenuBar = true
before setting visibility to false. No luck.
Has anyone else encountered this?
The BrowserWindow docs seem to indicate that what I am trying to do should work:
win.setMenuBarVisibility(visible) Windows Linux
visible Boolean
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single Alt key.
if (mainindow.isFullScreen()) {
// coming out of full screen
mainindow.setMenuBarVisibility(true);
mainindow.autohideMenuBar = false
mainindow.setFullScreen(false);
} else {
// entering full screen
mainindow.setMenuBarVisibility(false);
mainindow.autohideMenuBar = true
mainindow.setFullScreen(true);
}