Skip to content

Conversation

@vince-fugnitto
Copy link
Member

What it does

The following wip pull-request exposes an issue previously reported on our forum. When starting the application, we end up in a state when the top-level menu (main menu) is not visible:

image

How to test

  1. clean environment (rm -rf ~/.theia)
  2. build the example-browser application
  3. start the application, and notice the missing top-level menu

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto [email protected]

@vince-fugnitto vince-fugnitto added bug bugs found in the application menus issues related to the menu labels Sep 1, 2021
@vince-fugnitto
Copy link
Member Author

I confirmed that the issue seems to be caused by #9830.

Using the steps described by the pull-request, I was able to reproduce the issue on 6f80dc1 but not on the previous 5cc8eaf commit.

@msujew
Copy link
Member

msujew commented Sep 1, 2021

Adding:

this.showMenuBar(menuBar, this.corePreferences['window.menuBarVisibility']);

Somewhere in here:

createMenuBar(): MenuBarWidget {
const menuBar = new DynamicMenuBarWidget();
menuBar.id = 'theia:menubar';
const preferenceListener = this.corePreferences.onPreferenceChanged(preference => {

Does the trick. #9830 Seemed to remove the fillMenuBar call that existed previously.

@vince-fugnitto
Copy link
Member Author

Does the trick. #9830 Seemed to remove the fillMenuBar call that existed previously.

Same thing I tried locally :)

@vince-fugnitto vince-fugnitto marked this pull request as ready for review September 1, 2021 14:26
@vince-fugnitto
Copy link
Member Author

I'll drop the first commit (which exposes the issue) when approved 👍

@vince-fugnitto vince-fugnitto changed the title wip: expose 'top-menu' bug core: fix window.menuBarVisibility bug on startup Sep 1, 2021
Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me and follows the correct pattern for preference-conditioned startup. 👍

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm as well. The fix addresses the issue nicely 👍

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]>
@paul-marechal paul-marechal merged commit 395788d into master Sep 1, 2021
@paul-marechal paul-marechal deleted the vf/top-menu-bug branch September 1, 2021 18:46
@github-actions github-actions bot added this to the 1.18.0 milestone Sep 1, 2021
@vince-fugnitto vince-fugnitto modified the milestones: 1.18.0, 1.17.2 Sep 1, 2021
paul-marechal pushed a commit that referenced this pull request Sep 1, 2021
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]>
RomanNikitenko pushed a commit that referenced this pull request Sep 16, 2021
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]>
RomanNikitenko pushed a commit that referenced this pull request Sep 16, 2021
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]>
@colin-grant-work
Copy link
Contributor

@vince-fugnitto, it seems that this fix only solves the issue for the browser platform but not Electron, where the modified code doesn't run. I think it was coincidence that the application startup in Electron ran in such a way that a listener was attached in time to catch the initial preference setting; downstream, we're seeing that that isn't always the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug bugs found in the application menus issues related to the menu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants