From 574c4e98a7ad3f4c7783df32c558d84cb5627082 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Thu, 4 May 2023 13:32:52 -0400 Subject: [PATCH] Fix issue where Linux menubar pops up when it's not supposed to (#2709) --- src/main/windows/mainWindow.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/windows/mainWindow.ts b/src/main/windows/mainWindow.ts index 726919e8..a0aaf3af 100644 --- a/src/main/windows/mainWindow.ts +++ b/src/main/windows/mainWindow.ts @@ -97,7 +97,6 @@ export class MainWindow extends EventEmitter { throw new Error('unable to create main window'); } - this.win.setAutoHideMenuBar(true); this.win.setMenuBarVisibility(false); this.win.once('ready-to-show', () => { @@ -416,6 +415,9 @@ export class MainWindow extends EventEmitter { return; } + // For some reason on Linux I've seen the menu bar popup again + this.win?.setMenuBarVisibility(false); + this.emit(MAIN_WINDOW_RESIZED, newBounds); this.lastEmittedBounds = newBounds; }, 10); @@ -434,9 +436,6 @@ export class MainWindow extends EventEmitter { private onEnterFullScreen = () => { this.win?.webContents.send('enter-full-screen'); this.emitBounds(); - - // For some reason on Linux I've seen the menu bar popup again - this.win?.setMenuBarVisibility(false); } private onLeaveFullScreen = () => {