Skip to content

Commit 07e4664

Browse files
core: respect visible menu for fullscreen
The commit updates the handling of `toggle full screen` to respect `menuBarVisibility` properly. If the `menuBarVisibility` is set to `visible` the menu should be visible when the app is in fullscreen. Signed-off-by: vince-fugnitto <[email protected]>
1 parent cd33db1 commit 07e4664

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/core/src/electron-browser/menu/electron-menu-contribution.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class ElectronMenuContribution extends BrowserMenuBarContribution impleme
309309
registry.registerCommand(ElectronCommands.TOGGLE_FULL_SCREEN, {
310310
isEnabled: () => currentWindow.isFullScreenable(),
311311
isVisible: () => currentWindow.isFullScreenable(),
312-
execute: () => currentWindow.setFullScreen(!currentWindow.isFullScreen())
312+
execute: () => this.toggleFullScreen(currentWindow)
313313
});
314314
}
315315

@@ -377,4 +377,13 @@ export class ElectronMenuContribution extends BrowserMenuBarContribution impleme
377377
order: '0'
378378
});
379379
}
380+
381+
protected toggleFullScreen(currentWindow: electron.BrowserWindow): void {
382+
currentWindow.setFullScreen(!currentWindow.isFullScreen());
383+
if (currentWindow.isFullScreen()) {
384+
currentWindow.menuBarVisible = this.preferenceService.get('window.menuBarVisibility') === 'visible';
385+
} else {
386+
currentWindow.menuBarVisible = true;
387+
}
388+
}
380389
}

0 commit comments

Comments
 (0)