diff --git a/package.json b/package.json index 35a86a741d237..114ef5c376eaa 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,7 @@ "vscode-windows-registry": "1.0.1", "windows-foreground-love": "0.1.0", "windows-mutex": "0.2.1", - "windows-process-tree": "0.2.3" + "windows-process-tree": "0.2.3", + "windows-swca": "2.0.1" } } diff --git a/src/main.js b/src/main.js index 6d499413c7db3..2a740686364ba 100644 --- a/src/main.js +++ b/src/main.js @@ -151,6 +151,18 @@ function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) { if (cliArgs['disable-smooth-scrolling']) { app.commandLine.appendSwitch('disable-smooth-scrolling'); } + + // Linux: disable hardware acceleration when transparent window is enabled + if (process.platform === 'linux') { + const configFile = path.join(app.getPath('userData'), 'User', 'settings.json'); + bootstrap.readFile(configFile).then(content => { + const config = JSON.parse(stripComments(content)); + if (config['window.transparent']) { + app.commandLine.appendSwitch('enable-transparent-visuals'); + app.disableHardwareAcceleration(); + } + }); + } } /** diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index bbfe1bd21a052..f99e850c63347 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -5,6 +5,7 @@ import * as path from 'vs/base/common/path'; import * as objects from 'vs/base/common/objects'; +import * as os from 'os'; import * as nls from 'vs/nls'; import { URI } from 'vs/base/common/uri'; import { screen, BrowserWindow, systemPreferences, app, TouchBar, nativeImage, Rectangle, Display } from 'electron'; @@ -116,9 +117,6 @@ export class CodeWindow extends Disposable implements ICodeWindow { const [state, hasMultipleDisplays] = this.restoreWindowState(config.state); this.windowState = state; - // in case we are maximized or fullscreen, only show later after the call to maximize/fullscreen (see below) - const isFullscreenOrMaximized = (this.windowState.mode === WindowMode.Maximized || this.windowState.mode === WindowMode.Fullscreen); - const options: Electron.BrowserWindowConstructorOptions = { width: this.windowState.width, height: this.windowState.height, @@ -127,7 +125,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { backgroundColor: this.themeMainService.getBackgroundColor(), minWidth: CodeWindow.MIN_WIDTH, minHeight: CodeWindow.MIN_HEIGHT, - show: !isFullscreenOrMaximized, + show: false, title: product.nameLong, webPreferences: { // By default if Code is in the background, intervals and timeouts get throttled, so we @@ -140,14 +138,20 @@ export class CodeWindow extends Disposable implements ICodeWindow { if (isLinux) { options.icon = path.join(this.environmentService.appRoot, 'resources/linux/code.png'); // Windows and Mac are better off using the embedded icon(s) - } - const windowConfig = this.configurationService.getValue('window'); + // Make sure hardware acceleration is actually disabled. + //options.transparent = windowConfig && windowConfig.transparent && app.getGPUFeatureStatus().gpu_compositing !== 'enabled'; + //if (options.transparent) { + // options.backgroundColor = '#00000000'; + //} + } if (isMacintosh && !this.useNativeFullScreen()) { options.fullscreenable = false; // enables simple fullscreen mode } + const windowConfig = this.configurationService.getValue('window'); + if (isMacintosh) { options.acceptFirstMouse = true; // enabled by default @@ -178,6 +182,8 @@ export class CodeWindow extends Disposable implements ICodeWindow { this._win.setSheetOffset(22); // offset dialogs by the height of the custom title bar if we have any } + this.applyTransparency(windowConfig); + // TODO@Ben (Electron 4 regression): when running on multiple displays where the target display // to open the window has a larger resolution than the primary display, the window will not size // correctly unless we set the bounds again (https://github.com/microsoft/vscode/issues/74872) @@ -196,19 +202,68 @@ export class CodeWindow extends Disposable implements ICodeWindow { } } - if (isFullscreenOrMaximized) { + if (this.windowState.mode === WindowMode.Maximized) { this._win.maximize(); + } else if (this.windowState.mode === WindowMode.Fullscreen) { + this.setFullScreen(true); + } - if (this.windowState.mode === WindowMode.Fullscreen) { - this.setFullScreen(true); - } + // to reduce flicker from the default window size to maximize, we only show after maximize + // also prevents temporary background flash when transparency is set. + this._win.show(); - if (!this._win.isVisible()) { - this._win.show(); // to reduce flicker from the default window size to maximize, we only show after maximize + this._lastFocusTime = Date.now(); // since we show directly, we need to set the last focus time too + } + + private setCompositionAttribute(attribute: 'acrylic' | 'blur' | 'transparent' | 'none'): void { + const { ACCENT_STATE, SetWindowCompositionAttribute } = require.__$__nodeRequire('windows-swca'); + let attribValue = ACCENT_STATE.ACCENT_DISABLED; + switch (attribute) { + case 'acrylic': + // Fluent/acrylic flag was introduced in Windows 10 build 17063 (between FCU and April 2018 update) + if (parseInt(os.release().split('.')[2]) >= 17063) { + attribValue = ACCENT_STATE.ACCENT_ENABLE_ACRYLICBLURBEHIND; + } + break; + + case 'blur': + attribValue = ACCENT_STATE.ACCENT_ENABLE_BLURBEHIND; + break; + + case 'transparent': + attribValue = ACCENT_STATE.ACCENT_ENABLE_TRANSPARENTGRADIENT; + break; + } + + SetWindowCompositionAttribute(this._win.getNativeWindowHandle(), attribValue, 0); + } + + private applyTransparency(windowConfig: IWindowSettings): void { + let applied = false; + + if (windowConfig) { + if (isWindows && parseFloat(os.release()) >= 10) { + if (windowConfig.compositionAttribute && windowConfig.compositionAttribute !== 'none' && this.hasHiddenTitleBarStyle()) { + this.setCompositionAttribute(windowConfig.compositionAttribute); + applied = true; + } else { + this.setCompositionAttribute('none'); + } + } else if (isMacintosh && parseFloat(os.release()) >= 14) { + if (windowConfig.vibrancy && windowConfig.vibrancy !== 'none') { + this._win.setVibrancy(windowConfig.vibrancy); + applied = true; + } else { + // Documentation says to pass null to remove vibrancy but this is not reflected in the typings + this._win.setVibrancy(null as any); + } + } else if (isLinux) { + // TODO } } - this._lastFocusTime = Date.now(); // since we show directly, we need to set the last focus time too + // FIXME: on windows, background is pitchblack at startup until the user changes the composition attribute in settings + this._win.setBackgroundColor(applied ? '#00000000' : this.themeMainService.getBackgroundColor()); } hasHiddenTitleBarStyle(): boolean { @@ -471,6 +526,8 @@ export class CodeWindow extends Disposable implements ICodeWindow { this._win.removeAllListeners('swipe'); } } + + this.applyTransparency(this.configurationService.getValue('window')); } private registerNavigationListenerOn(command: 'swipe' | 'app-command', back: 'left' | 'browser-backward', forward: 'right' | 'browser-forward', acrossEditors: boolean) { diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 1641841c2f897..3069c7606f998 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -419,6 +419,7 @@ class MinimapBuffers { const backgroundR = background.r; const backgroundG = background.g; const backgroundB = background.b; + const backgroundA = background.a; const result = new Uint8ClampedArray(WIDTH * HEIGHT * 4); let offset = 0; @@ -427,7 +428,7 @@ class MinimapBuffers { result[offset] = backgroundR; result[offset + 1] = backgroundG; result[offset + 2] = backgroundB; - result[offset + 3] = 255; + result[offset + 3] = backgroundA; offset += 4; } } diff --git a/src/vs/editor/common/view/minimapCharRenderer.ts b/src/vs/editor/common/view/minimapCharRenderer.ts index adae1644741ea..252b10908088f 100644 --- a/src/vs/editor/common/view/minimapCharRenderer.ts +++ b/src/vs/editor/common/view/minimapCharRenderer.ts @@ -135,10 +135,12 @@ export class MinimapCharRenderer { const backgroundR = backgroundColor.r; const backgroundG = backgroundColor.g; const backgroundB = backgroundColor.b; + const backgroundA = backgroundColor.a; const deltaR = color.r - backgroundR; const deltaG = color.g - backgroundG; const deltaB = color.b - backgroundB; + const deltaA = color.a - backgroundA; const dest = target.data; const sourceOffset = chIndex * Constants.x2_CHAR_HEIGHT * Constants.x2_CHAR_WIDTH; @@ -148,12 +150,14 @@ export class MinimapCharRenderer { dest[destOffset + 0] = backgroundR + deltaR * c; dest[destOffset + 1] = backgroundG + deltaG * c; dest[destOffset + 2] = backgroundB + deltaB * c; + dest[destOffset + 3] = backgroundA + deltaA * c; } { const c = x2CharData[sourceOffset + 1] / 255; dest[destOffset + 4] = backgroundR + deltaR * c; dest[destOffset + 5] = backgroundG + deltaG * c; dest[destOffset + 6] = backgroundB + deltaB * c; + dest[destOffset + 7] = backgroundA + deltaA * c; } destOffset += outWidth; @@ -162,12 +166,14 @@ export class MinimapCharRenderer { dest[destOffset + 0] = backgroundR + deltaR * c; dest[destOffset + 1] = backgroundG + deltaG * c; dest[destOffset + 2] = backgroundB + deltaB * c; + dest[destOffset + 3] = backgroundA + deltaA * c; } { const c = x2CharData[sourceOffset + 3] / 255; dest[destOffset + 4] = backgroundR + deltaR * c; dest[destOffset + 5] = backgroundG + deltaG * c; dest[destOffset + 6] = backgroundB + deltaB * c; + dest[destOffset + 7] = backgroundA + deltaA * c; } destOffset += outWidth; @@ -176,12 +182,14 @@ export class MinimapCharRenderer { dest[destOffset + 0] = backgroundR + deltaR * c; dest[destOffset + 1] = backgroundG + deltaG * c; dest[destOffset + 2] = backgroundB + deltaB * c; + dest[destOffset + 3] = backgroundA + deltaA * c; } { const c = x2CharData[sourceOffset + 5] / 255; dest[destOffset + 4] = backgroundR + deltaR * c; dest[destOffset + 5] = backgroundG + deltaG * c; dest[destOffset + 6] = backgroundB + deltaB * c; + dest[destOffset + 7] = backgroundA + deltaA * c; } destOffset += outWidth; @@ -190,12 +198,14 @@ export class MinimapCharRenderer { dest[destOffset + 0] = backgroundR + deltaR * c; dest[destOffset + 1] = backgroundG + deltaG * c; dest[destOffset + 2] = backgroundB + deltaB * c; + dest[destOffset + 3] = backgroundA + deltaA * c; } { const c = x2CharData[sourceOffset + 7] / 255; dest[destOffset + 4] = backgroundR + deltaR * c; dest[destOffset + 5] = backgroundG + deltaG * c; dest[destOffset + 6] = backgroundB + deltaB * c; + dest[destOffset + 7] = backgroundA + deltaA * c; } } @@ -212,10 +222,12 @@ export class MinimapCharRenderer { const backgroundR = backgroundColor.r; const backgroundG = backgroundColor.g; const backgroundB = backgroundColor.b; + const backgroundA = backgroundColor.a; const deltaR = color.r - backgroundR; const deltaG = color.g - backgroundG; const deltaB = color.b - backgroundB; + const deltaA = color.a - backgroundA; const dest = target.data; const sourceOffset = chIndex * Constants.x1_CHAR_HEIGHT * Constants.x1_CHAR_WIDTH; @@ -225,6 +237,7 @@ export class MinimapCharRenderer { dest[destOffset + 0] = backgroundR + deltaR * c; dest[destOffset + 1] = backgroundG + deltaG * c; dest[destOffset + 2] = backgroundB + deltaB * c; + dest[destOffset + 3] = backgroundA + deltaA * c; } destOffset += outWidth; @@ -233,6 +246,7 @@ export class MinimapCharRenderer { dest[destOffset + 0] = backgroundR + deltaR * c; dest[destOffset + 1] = backgroundG + deltaG * c; dest[destOffset + 2] = backgroundB + deltaB * c; + dest[destOffset + 3] = backgroundA + deltaA * c; } } @@ -249,14 +263,17 @@ export class MinimapCharRenderer { const backgroundR = backgroundColor.r; const backgroundG = backgroundColor.g; const backgroundB = backgroundColor.b; + const backgroundA = backgroundColor.a; const deltaR = color.r - backgroundR; const deltaG = color.g - backgroundG; const deltaB = color.b - backgroundB; + const deltaA = color.a - backgroundA; const colorR = backgroundR + deltaR * c; const colorG = backgroundG + deltaG * c; const colorB = backgroundB + deltaB * c; + const colorA = backgroundA + deltaA * c; const dest = target.data; let destOffset = dy * outWidth + dx * Constants.RGBA_CHANNELS_CNT; @@ -264,11 +281,13 @@ export class MinimapCharRenderer { dest[destOffset + 0] = colorR; dest[destOffset + 1] = colorG; dest[destOffset + 2] = colorB; + dest[destOffset + 3] = colorA; } { dest[destOffset + 4] = colorR; dest[destOffset + 5] = colorG; dest[destOffset + 6] = colorB; + dest[destOffset + 7] = colorA; } destOffset += outWidth; @@ -276,11 +295,13 @@ export class MinimapCharRenderer { dest[destOffset + 0] = colorR; dest[destOffset + 1] = colorG; dest[destOffset + 2] = colorB; + dest[destOffset + 3] = colorA; } { dest[destOffset + 4] = colorR; dest[destOffset + 5] = colorG; dest[destOffset + 6] = colorB; + dest[destOffset + 7] = colorA; } destOffset += outWidth; @@ -288,11 +309,13 @@ export class MinimapCharRenderer { dest[destOffset + 0] = colorR; dest[destOffset + 1] = colorG; dest[destOffset + 2] = colorB; + dest[destOffset + 3] = colorA; } { dest[destOffset + 4] = colorR; dest[destOffset + 5] = colorG; dest[destOffset + 6] = colorB; + dest[destOffset + 7] = colorA; } destOffset += outWidth; @@ -300,11 +323,13 @@ export class MinimapCharRenderer { dest[destOffset + 0] = colorR; dest[destOffset + 1] = colorG; dest[destOffset + 2] = colorB; + dest[destOffset + 3] = colorA; } { dest[destOffset + 4] = colorR; dest[destOffset + 5] = colorG; dest[destOffset + 6] = colorB; + dest[destOffset + 7] = colorA; } } @@ -321,14 +346,17 @@ export class MinimapCharRenderer { const backgroundR = backgroundColor.r; const backgroundG = backgroundColor.g; const backgroundB = backgroundColor.b; + const backgroundA = backgroundColor.a; const deltaR = color.r - backgroundR; const deltaG = color.g - backgroundG; const deltaB = color.b - backgroundB; + const deltaA = color.a - backgroundA; const colorR = backgroundR + deltaR * c; const colorG = backgroundG + deltaG * c; const colorB = backgroundB + deltaB * c; + const colorA = backgroundA + deltaA * c; const dest = target.data; @@ -337,6 +365,7 @@ export class MinimapCharRenderer { dest[destOffset + 0] = colorR; dest[destOffset + 1] = colorG; dest[destOffset + 2] = colorB; + dest[destOffset + 3] = colorA; } destOffset += outWidth; @@ -344,6 +373,7 @@ export class MinimapCharRenderer { dest[destOffset + 0] = colorR; dest[destOffset + 1] = colorG; dest[destOffset + 2] = colorB; + dest[destOffset + 3] = colorA; } } } diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 1f64adccc5b49..9af51a0d04657 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -282,6 +282,9 @@ export interface IWindowSettings { enableMenuBarMnemonics: boolean; closeWhenEmpty: boolean; clickThroughInactive: boolean; + transparent: boolean; + compositionAttribute: 'none' | 'transparent' | 'blur' | 'acrylic'; + vibrancy: 'none' | 'appearance-based' | 'light' | 'dark' | 'titlebar' | 'medium-light' | 'ultra-dark'; } export function getTitleBarStyle(configurationService: IConfigurationService, environment: IEnvironmentService, isExtensionDevelopment = environment.isExtensionDevelopment): 'native' | 'custom' { diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 8fa00b20595a3..9136123377216 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -1237,18 +1237,18 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { // Fade out styles via linear gradient (when tabs are set to shrink) if (theme.type !== 'hc') { - const workbenchBackground = WORKBENCH_BACKGROUND(theme); + const workbenchBackground = theme.getColor(WORKBENCH_BACKGROUND); const editorBackgroundColor = theme.getColor(editorBackground); const editorGroupHeaderTabsBackground = theme.getColor(EDITOR_GROUP_HEADER_TABS_BACKGROUND); const editorDragAndDropBackground = theme.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND); let adjustedTabBackground: Color | undefined; - if (editorGroupHeaderTabsBackground && editorBackgroundColor) { + if (editorGroupHeaderTabsBackground && editorBackgroundColor && workbenchBackground) { adjustedTabBackground = editorGroupHeaderTabsBackground.flatten(editorBackgroundColor, editorBackgroundColor, workbenchBackground); } let adjustedTabDragBackground: Color | undefined; - if (editorGroupHeaderTabsBackground && editorBackgroundColor && editorDragAndDropBackground && editorBackgroundColor) { + if (editorGroupHeaderTabsBackground && editorBackgroundColor && editorDragAndDropBackground && editorBackgroundColor && workbenchBackground) { adjustedTabDragBackground = editorGroupHeaderTabsBackground.flatten(editorBackgroundColor, editorDragAndDropBackground, editorBackgroundColor, workbenchBackground); } diff --git a/src/vs/workbench/browser/style.ts b/src/vs/workbench/browser/style.ts index dbb318045f528..02798d1a209de 100644 --- a/src/vs/workbench/browser/style.ts +++ b/src/vs/workbench/browser/style.ts @@ -42,7 +42,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { } // We need to set the workbench background color so that on Windows we get subpixel-antialiasing. - const workbenchBackground = WORKBENCH_BACKGROUND(theme); + const workbenchBackground = theme.getColor(WORKBENCH_BACKGROUND); collector.addRule(`.monaco-workbench { background-color: ${workbenchBackground}; }`); // Scrollbars diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index bc1a15ee2e7c0..36f375168452c 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -9,18 +9,13 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; -// < --- Workbench (not customizable) --- > - -export function WORKBENCH_BACKGROUND(theme: ITheme): Color { - switch (theme.type) { - case 'dark': - return Color.fromHex('#252526'); - case 'light': - return Color.fromHex('#F3F3F3'); - default: - return Color.fromHex('#000000'); - } -} +// < --- Workbench --- > + +export const WORKBENCH_BACKGROUND = registerColor('workbench.background', { + dark: '#252526', + light: '#F3F3F3', + hc: '#000000' +}, nls.localize('workbenchBackground', "Top-level background color. Not seen unless other elements have a transparent color.")); // < --- Tabs --- > diff --git a/src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts index dc4f08e446ee4..833857482a4bd 100644 --- a/src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts @@ -30,6 +30,7 @@ interface IConfiguration extends IWindowsConfiguration { export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution { + private transparent: boolean; private titleBarStyle: 'native' | 'custom'; private nativeTabs: boolean; private nativeFullScreen: boolean; @@ -57,6 +58,12 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo private onConfigurationChange(config: IConfiguration, notify: boolean): void { let changed = false; + // Linux transparency + if (isLinux && config.window && typeof config.window.transparent === 'boolean' && config.window.transparent !== this.transparent) { + this.transparent = config.window.transparent; + changed = true; + } + // Titlebar style if (config.window && config.window.titleBarStyle !== this.titleBarStyle && (config.window.titleBarStyle === 'native' || config.window.titleBarStyle === 'custom')) { this.titleBarStyle = config.window.titleBarStyle; diff --git a/src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts b/src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts index 8fc47ec3f777e..362daef8267d9 100644 --- a/src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts +++ b/src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts @@ -103,9 +103,11 @@ class PartsSplash { this._lastBackground = colorInfo.editorBackground; // the color needs to be in hex - const backgroundColor = this._themeService.getTheme().getColor(editorBackground) || themes.WORKBENCH_BACKGROUND(this._themeService.getTheme()); - const payload = JSON.stringify({ baseTheme, background: Color.Format.CSS.formatHex(backgroundColor) }); - ipc.send('vscode:changeColorTheme', this.windowService.windowId, payload); + const backgroundColor = this._themeService.getTheme().getColor(editorBackground) || this._themeService.getTheme().getColor(themes.WORKBENCH_BACKGROUND); + if (backgroundColor) { + const payload = JSON.stringify({ baseTheme, background: Color.Format.CSS.formatHex(backgroundColor) }); + ipc.send('vscode:changeColorTheme', this.windowService.windowId, payload); + } } } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 05fdc623efa23..d0ab06886a645 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -445,7 +445,8 @@ export class TerminalInstance implements ITerminalInstance { macOptionClickForcesSelection: config.macOptionClickForcesSelection, rightClickSelectsWord: config.rightClickBehavior === 'selectWord', // TODO: Guess whether to use canvas or dom better - rendererType: config.rendererType === 'auto' ? 'canvas' : config.rendererType + rendererType: config.rendererType === 'auto' ? 'canvas' : config.rendererType, + allowTransparency: true }); this._terminalInstanceService.getXtermSearchConstructor().then(Addon => { this._xtermSearch = new Addon(); diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 04680562078c1..711e787fbf789 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -516,6 +516,35 @@ import product from 'vs/platform/product/node/product'; 'scope': ConfigurationScope.APPLICATION, 'description': nls.localize('window.clickThroughInactive', "If enabled, clicking on an inactive window will both activate the window and trigger the element under the mouse if it is clickable. If disabled, clicking anywhere on an inactive window will activate it only and a second click is required on the element."), 'included': isMacintosh + }, + 'window.transparent': { + 'type': 'boolean', + 'default': false, + 'scope': ConfigurationScope.APPLICATION, + 'description': nls.localize('window.transparent', "Makes window ARGB. Needs color customizations or a transparent theme to affect appearance. IMPORTANT: Disables hardware acceleration."), + 'included': isLinux + }, + 'window.compositionAttribute': { + 'type': 'string', + 'enum': ['none', 'transparent', 'blur', 'acrylic'], + 'enumDescriptions': [ + nls.localize('window.compositionAttribute.none', "No special effect or transparency."), + nls.localize('window.compositionAttribute.transparent', "Transparent."), + nls.localize('window.compositionAttribute.blur', "Transparent and blurred."), + nls.localize('window.compositionAttribute.acrylic', "Transparent, heavily blurred and grainy. Requires the Windows 10 April 2018 update, and has lag issues when dragging the window in the May 2019 update.") + ], + 'default': 'none', + 'scope': ConfigurationScope.APPLICATION, + 'description': nls.localize('window.compositionAttribute', "Changes window composition attribute. Requires custom titlebar to be active. Needs color customizations or a transparent theme to affect appearance."), + 'included': isWindows && parseFloat(os.release()) >= 10 + }, + 'window.vibrancy': { + 'type': 'string', + 'enum': ['none', 'appearance-based', 'light', 'dark', 'titlebar', 'medium-light', 'ultra-dark'], + 'default': 'none', + 'scope': ConfigurationScope.APPLICATION, + 'description': nls.localize('window.vibrancy', "Sets window vibrancy effect. Needs color customizations or a transparent theme to affect appearance."), + 'included': isMacintosh && parseFloat(os.release()) >= 14 } } }); diff --git a/yarn.lock b/yarn.lock index 8f54d42097813..899cb20f5213b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -65,6 +65,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.12.tgz#e15a9d034d9210f00320ef718a50c4a799417c47" integrity sha512-Pr+6JRiKkfsFvmU/LK68oBRCQeEg36TyAbPhc2xpez24OOZZCuoIhWGTd39VZy6nGafSbxzGouFPTFD/rR1A0A== +"@types/node@^10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + "@types/semver@^5.4.0", "@types/semver@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" @@ -9679,6 +9684,13 @@ windows-process-tree@0.2.3: dependencies: nan "^2.10.0" +windows-swca@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/windows-swca/-/windows-swca-2.0.1.tgz#25d78ce25251292061494a0ad07c02282b28b4e3" + integrity sha512-flj+HD6RUemZUvKKguLLnMUOYkQSgDu9qrhUIO4cydvtb/x+sxU8XmpZUtugYuydcdikB9zsCOMgKnAqIQ+7nw== + dependencies: + "@types/node" "^10.12.18" + wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"