fix: hiding window menu should work on startup (#21436)
* fix: menu visibility should not be overwritten on startup * fix: removing menu for window without global menubar * test: setMenu tests are not for mac
This commit is contained in:
parent
7f6b308bf1
commit
3cb0ed306b
7 changed files with 88 additions and 15 deletions
17
spec-main/fixtures/api/test-menu-visibility/main.js
Normal file
17
spec-main/fixtures/api/test-menu-visibility/main.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
let win
|
||||
app.on('ready', function () {
|
||||
win = new BrowserWindow({})
|
||||
win.loadURL('about:blank')
|
||||
win.setMenuBarVisibility(false)
|
||||
|
||||
setTimeout(() => {
|
||||
if (win.isMenuBarVisible()) {
|
||||
console.log('Window has a menu')
|
||||
} else {
|
||||
console.log('Window has no menu')
|
||||
}
|
||||
app.quit()
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue