Skip to content

Commit 2332f54

Browse files
core: fix menuBarVisibility
The commit fixes an issue with the `window.menuBarVisibility` preference where the menu is not set correctly on startup since we wait for the preference-change event. The fix sets the menu when the preferences are ready, and updates on preference changes. Signed-off-by: vince-fugnitto <[email protected]>
1 parent 7fac97f commit 2332f54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/browser/menu/browser-menu-plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export class BrowserMainMenuFactory implements MenuWidgetFactory {
5858
createMenuBar(): MenuBarWidget {
5959
const menuBar = new DynamicMenuBarWidget();
6060
menuBar.id = 'theia:menubar';
61+
this.corePreferences.ready.then(() => {
62+
this.showMenuBar(menuBar, this.corePreferences.get('window.menuBarVisibility', 'classic'));
63+
});
6164
const preferenceListener = this.corePreferences.onPreferenceChanged(preference => {
6265
if (preference.preferenceName === 'window.menuBarVisibility') {
6366
this.showMenuBar(menuBar, preference.newValue);

0 commit comments

Comments
 (0)