Skip to content

Commit 598a2e1

Browse files
author
Tajudeen
committed
Fix Linux dropdown issue: add isLinux support to menubar dropdown handling
1 parent e4f2e73 commit 598a2e1

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/vs/base/browser/ui/menu/menubar.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
border-radius: 5px;
5757
}
5858

59-
/* Standalone rule for when menu is appended to document.body (Windows) */
59+
/* Standalone rule for when menu is appended to document.body (Windows and Linux) */
6060
.menubar-menu-items-holder {
6161
position: fixed;
6262
opacity: 1;
@@ -80,7 +80,7 @@
8080
position: fixed;
8181
}
8282

83-
/* Standalone rule for when menu is appended to document.body (Windows) */
83+
/* Standalone rule for when menu is appended to document.body (Windows and Linux) */
8484
.menubar-menu-items-holder.monaco-menu-container {
8585
outline: 0;
8686
border: none;
@@ -104,8 +104,8 @@
104104
outline: 0;
105105
}
106106

107-
/* Windows-specific: Ensure menu is visible when appended to document.body */
108-
/* Note: On Windows, menu is appended to body, so we target body > selector */
107+
/* Windows and Linux-specific: Ensure menu is visible when appended to document.body */
108+
/* Note: On Windows and Linux, menu is appended to body, so we target body > selector */
109109
body > .menubar-menu-items-holder.monaco-menu-container {
110110
position: fixed !important;
111111
z-index: 10000 !important;

src/vs/base/browser/ui/menu/menubar.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Emitter, Event } from '../../../common/event.js';
1818
import { KeyCode, KeyMod, ScanCode, ScanCodeUtils } from '../../../common/keyCodes.js';
1919
import { ResolvedKeybinding } from '../../../common/keybindings.js';
2020
import { Disposable, DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';
21-
import { isMacintosh, isWindows } from '../../../common/platform.js';
21+
import { isLinux, isMacintosh, isWindows } from '../../../common/platform.js';
2222
import * as strings from '../../../common/strings.js';
2323
import './menubar.css';
2424
import * as nls from '../../../../nls.js';
@@ -1082,9 +1082,10 @@ export class MenuBar extends Disposable {
10821082
menuHolder.style.opacity = '1';
10831083
menuHolder.style.pointerEvents = 'auto';
10841084

1085-
// On Windows, append dropdown to document.body to avoid stacking context issues
1085+
// On Windows and Linux, append dropdown to document.body to avoid stacking context issues
10861086
// where the dropdown renders behind the workbench content
1087-
if (isWindows) {
1087+
// Linux experiences the same stacking context issues as Windows
1088+
if (isWindows || isLinux) {
10881089
const window = DOM.getWindow(this.container);
10891090
window.document.body.appendChild(menuHolder);
10901091
} else {

0 commit comments

Comments
 (0)