Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problems related with menu bar updates on focus change. #14959

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

tsmaeder
Copy link
Contributor

What it does

This PR introduces an event object describing changes to the menu registry more precisely. The code that manages the menu bar then only rebuilds itself when the change actually concerns the main menu bar. This prevents the menu bar from being replaced when the keyboard focus changes.

Fixes #14002

How to test

Make sure you set the "title bar style" setting to "custom" (This issue does not affect the native menus). Observe that the Sample menu appears dynamically and is correctly displayed and works. Make sure the scenario from the linked issue is fixed. Test electron and browser cases.

Follow-ups

This is a workaround that fixes the problem at hand. To attack the root problem, we would have to solve #14879

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Contributed on behalf of STMicroelectronics

Review checklist

Reminder for reviewers

Fixes eclipse-theia#14002

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder tsmaeder requested a review from msujew February 18, 2025 14:37
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.

Looks good to me 👍

Comment on lines 163 to 165
export function isMenuElement(element: HTMLElement | null): boolean {
return !!element && element.className.includes('lm-Menu');
}
Copy link
Member

Choose a reason for hiding this comment

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

Question: Is this required? It does not seem to be in use and also uses Lumino stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I ported this commit from the lumino-PR.

@tsmaeder tsmaeder merged commit f067116 into eclipse-theia:master Feb 20, 2025
10 of 11 checks passed
@github-actions github-actions bot added this to the 1.59.0 milestone Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Menu bar does not open on first click when certain sidebar elements have focus
2 participants