提交 5c565a14 编写于 作者: S SteVen Batten

fixes #85304

上级 26a8754f
...@@ -91,7 +91,7 @@ export interface IWindowSettings { ...@@ -91,7 +91,7 @@ export interface IWindowSettings {
titleBarStyle: 'native' | 'custom'; titleBarStyle: 'native' | 'custom';
autoDetectHighContrast: boolean; autoDetectHighContrast: boolean;
menuBarVisibility: MenuBarVisibility; menuBarVisibility: MenuBarVisibility;
newWindowDimensions: 'default' | 'inherit' | 'maximized' | 'fullscreen'; newWindowDimensions: 'default' | 'inherit' | 'offset' | 'maximized' | 'fullscreen';
nativeTabs: boolean; nativeTabs: boolean;
nativeFullScreen: boolean; nativeFullScreen: boolean;
enableMenuBarMnemonics: boolean; enableMenuBarMnemonics: boolean;
......
...@@ -1381,7 +1381,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic ...@@ -1381,7 +1381,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// Window state is not from a previous session: only allow fullscreen if we inherit it or user wants fullscreen // Window state is not from a previous session: only allow fullscreen if we inherit it or user wants fullscreen
let allowFullscreen: boolean; let allowFullscreen: boolean;
if (state.hasDefaultState) { if (state.hasDefaultState) {
allowFullscreen = (windowConfig?.newWindowDimensions && ['fullscreen', 'inherit'].indexOf(windowConfig.newWindowDimensions) >= 0); allowFullscreen = (windowConfig?.newWindowDimensions && ['fullscreen', 'inherit', 'offset'].indexOf(windowConfig.newWindowDimensions) >= 0);
} }
// Window state is from a previous session: only allow fullscreen when we got updated or user wants to restore // Window state is from a previous session: only allow fullscreen when we got updated or user wants to restore
...@@ -1576,7 +1576,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic ...@@ -1576,7 +1576,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
} else if (windowConfig.newWindowDimensions === 'fullscreen') { } else if (windowConfig.newWindowDimensions === 'fullscreen') {
state.mode = WindowMode.Fullscreen; state.mode = WindowMode.Fullscreen;
ensureNoOverlap = false; ensureNoOverlap = false;
} else if (windowConfig.newWindowDimensions === 'inherit' && lastActive) { } else if ((windowConfig.newWindowDimensions === 'inherit' || windowConfig.newWindowDimensions === 'offset') && lastActive) {
const lastActiveState = lastActive.serializeWindowState(); const lastActiveState = lastActive.serializeWindowState();
if (lastActiveState.mode === WindowMode.Fullscreen) { if (lastActiveState.mode === WindowMode.Fullscreen) {
state.mode = WindowMode.Fullscreen; // only take mode (fixes https://github.com/Microsoft/vscode/issues/19331) state.mode = WindowMode.Fullscreen; // only take mode (fixes https://github.com/Microsoft/vscode/issues/19331)
...@@ -1584,7 +1584,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic ...@@ -1584,7 +1584,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
state = lastActiveState; state = lastActiveState;
} }
ensureNoOverlap = false; ensureNoOverlap = state.mode !== WindowMode.Fullscreen && windowConfig.newWindowDimensions === 'offset';
} }
} }
......
...@@ -256,10 +256,11 @@ import product from 'vs/platform/product/common/product'; ...@@ -256,10 +256,11 @@ import product from 'vs/platform/product/common/product';
}, },
'window.newWindowDimensions': { 'window.newWindowDimensions': {
'type': 'string', 'type': 'string',
'enum': ['default', 'inherit', 'maximized', 'fullscreen'], 'enum': ['default', 'inherit', 'offset', 'maximized', 'fullscreen'],
'enumDescriptions': [ 'enumDescriptions': [
nls.localize('window.newWindowDimensions.default', "Open new windows in the center of the screen."), nls.localize('window.newWindowDimensions.default', "Open new windows in the center of the screen."),
nls.localize('window.newWindowDimensions.inherit', "Open new windows with same dimension as last active one."), nls.localize('window.newWindowDimensions.inherit', "Open new windows with same dimension as last active one."),
nls.localize('window.newWindowDimensions.offset', "Open new windows with same dimension as last active one with an offset position."),
nls.localize('window.newWindowDimensions.maximized', "Open new windows maximized."), nls.localize('window.newWindowDimensions.maximized', "Open new windows maximized."),
nls.localize('window.newWindowDimensions.fullscreen', "Open new windows in full screen mode.") nls.localize('window.newWindowDimensions.fullscreen', "Open new windows in full screen mode.")
], ],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册