File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
auxiliaryWindow/electron-main Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { BrowserWindow , WebContents } from 'electron' ;
7
+ import { isLinux , isWindows } from 'vs/base/common/platform' ;
7
8
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
8
9
import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService' ;
9
10
import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService' ;
10
11
import { ILogService } from 'vs/platform/log/common/log' ;
11
12
import { IStateService } from 'vs/platform/state/node/state' ;
13
+ import { hasNativeTitlebar } from 'vs/platform/window/common/window' ;
12
14
import { IBaseWindow } from 'vs/platform/window/electron-main/window' ;
13
15
import { BaseWindow } from 'vs/platform/windows/electron-main/windowImpl' ;
14
16
@@ -61,6 +63,9 @@ export class AuxiliaryWindow extends BaseWindow implements IAuxiliaryWindow {
61
63
62
64
// Disable Menu
63
65
window . setMenu ( null ) ;
66
+ if ( ( isWindows || isLinux ) && hasNativeTitlebar ( this . configurationService ) ) {
67
+ window . setAutoHideMenuBar ( true ) ; // Fix for https://github.com/microsoft/vscode/issues/200615
68
+ }
64
69
65
70
// Lifecycle
66
71
this . lifecycleMainService . registerAuxWindow ( this ) ;
Original file line number Diff line number Diff line change @@ -379,6 +379,13 @@ export class Menubar {
379
379
// Setting the application menu sets it to all opened windows,
380
380
// but we currently do not support a menu in auxiliary windows,
381
381
// so we need to unset it there.
382
+ //
383
+ // This is a bit ugly but `setApplicationMenu()` has some nice
384
+ // behaviour we want:
385
+ // - on macOS it is required because menus are application set
386
+ // - we use `getApplicationMenu()` to access the current state
387
+ // - new windows immediately get the same menu when opening
388
+ // reducing overall flicker for these
382
389
383
390
Menu . setApplicationMenu ( menu ) ;
384
391
You can’t perform that action at this time.
0 commit comments