Stop Auto Hide Menu Bar (Electron on Mac)

258 views Asked by At

How can you make sure that the menu bar stays active when a BrowserWindow in Electron is visible?

Case Explanation: Once you click on my Tray icon, a BrowserWindow is opened with some HTML. Once the cursor moves down from the Mac menu bar, the menu bar is hidden, but the BrowserWindow is still visible.

Desired Case: Ideally, the Mac menu bar remains visible until the BrowserWindow is de-focused and hidden.

Here is an image of how the problem looks:

enter image description here

Interestingly, when I create a context menu instead of having a custom BrowserWindow...

const contextMenu = Menu.buildFromTemplate([
    { label: 'Item1', type: 'radio' },
    { label: 'Item2', type: 'radio' },
    { label: 'Item3', type: 'radio', checked: true },
    { label: 'Item4', type: 'radio' }
])

tray.setContextMenu(contextMenu)

... the Mac menu bar remains. See this image:

enter image description here

0

There are 0 answers