mirror of
https://github.com/coder/code-server.git
synced 2026-05-10 22:37:26 +02:00
chore(vscode): update to 1.54.2
This commit is contained in:
@@ -746,7 +746,7 @@ export class MenuBar extends Disposable {
|
||||
private setUnfocusedState(): void {
|
||||
if (this.options.visibility === 'toggle' || this.options.visibility === 'hidden') {
|
||||
this.focusState = MenubarState.HIDDEN;
|
||||
} else if (this.options.visibility === 'default' && browser.isFullscreen()) {
|
||||
} else if (this.options.visibility === 'classic' && browser.isFullscreen()) {
|
||||
this.focusState = MenubarState.HIDDEN;
|
||||
} else {
|
||||
this.focusState = MenubarState.VISIBLE;
|
||||
@@ -838,6 +838,22 @@ export class MenuBar extends Disposable {
|
||||
this._mnemonicsInUse = value;
|
||||
}
|
||||
|
||||
private get shouldAltKeyFocus(): boolean {
|
||||
if (isMacintosh) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.options.disableAltFocus) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.options.visibility === 'toggle') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public get onVisibilityChange(): Event<boolean> {
|
||||
return this._onVisibilityChange.event;
|
||||
}
|
||||
@@ -869,7 +885,7 @@ export class MenuBar extends Disposable {
|
||||
}
|
||||
|
||||
// Prevent alt-key default if the menu is not hidden and we use alt to focus
|
||||
if (modifierKeyStatus.event && !this.options.disableAltFocus) {
|
||||
if (modifierKeyStatus.event && this.shouldAltKeyFocus) {
|
||||
if (ScanCodeUtils.toEnum(modifierKeyStatus.event.code) === ScanCode.AltLeft) {
|
||||
modifierKeyStatus.event.preventDefault();
|
||||
}
|
||||
@@ -885,7 +901,7 @@ export class MenuBar extends Disposable {
|
||||
// Clean alt key press and release
|
||||
if (allModifiersReleased && modifierKeyStatus.lastKeyPressed === 'alt' && modifierKeyStatus.lastKeyReleased === 'alt') {
|
||||
if (!this.awaitingAltRelease) {
|
||||
if (!this.isFocused && !(this.options.disableAltFocus && this.options.visibility !== 'toggle')) {
|
||||
if (!this.isFocused && this.shouldAltKeyFocus) {
|
||||
this.mnemonicsInUse = true;
|
||||
this.focusedMenu = { index: this.numMenusShown > 0 ? 0 : MenuBar.OVERFLOW_INDEX };
|
||||
this.focusState = MenubarState.FOCUSED;
|
||||
|
||||
Reference in New Issue
Block a user