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

enable dynamic menu on linux/windows #59936

Merged
merged 3 commits into from
Oct 4, 2018
Merged

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Oct 3, 2018

workaround to fix #55347

@sbatten sbatten added linux Issues with VS Code on Linux windows VS Code on Windows issues workbench-menu labels Oct 3, 2018
@sbatten sbatten added this to the October 2018 milestone Oct 3, 2018
@sbatten sbatten self-assigned this Oct 3, 2018
@sbatten sbatten requested a review from bpasero October 3, 2018 22:31
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

Some feedback provided

@@ -36,6 +36,9 @@ export class Menubar {
private closedLastWindow: boolean;

private menuUpdater: RunOnceScheduler;
private menuGC: RunOnceScheduler;

private oldMenus: Menu[];
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten this needs a comment at least why we are doing it with a reference to the electron issue and a TODO to remove this when Electron fixed it!

@@ -56,6 +59,8 @@ export class Menubar {
) {
this.menuUpdater = new RunOnceScheduler(() => this.doUpdateMenu(), 0);

this.menuGC = new RunOnceScheduler(() => { this.oldMenus = this.oldMenus.slice(this.oldMenus.length - 1); }, 10000);
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten I am not sure it helps to always keep the last menu around, I would probably empty the entire array after 10 seconds. Reason is that the user might be lucky to open the menu very early, then we got 2-3 updates and so the last menu in this array will not be the one the user had opened anyways.

@@ -203,6 +210,11 @@ export class Menubar {

private install(): void {

const oldMenu = Menu.getApplicationMenu();
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten again, comment to explain why

@sbatten sbatten merged commit e4172c2 into microsoft:master Oct 4, 2018
@sbatten sbatten deleted the fix/55347 branch October 4, 2018 17:41
@kieferrm kieferrm mentioned this pull request Oct 16, 2018
38 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linux Issues with VS Code on Linux windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic items in menu bar can cause crash
2 participants