diff --git a/src/main.js b/src/main.js --- a/src/main.js +++ b/src/main.js @@ -157,6 +157,10 @@ } } }); + // enable transparent + app.commandLine.appendSwitch('enable-transparent-visuals'); + app.commandLine.appendSwitch('use-gl', 'desktop'); + // Support JS Flags const jsFlags = getJSFlags(cliArgs); if (jsFlags) { diff --git a/src/vs/platform/theme/electron-main/themeMainService.ts b/src/vs/platform/theme/electron-main/themeMainService.ts index 189811d6fdf..d10bd05bced 100644 --- a/src/vs/platform/theme/electron-main/themeMainService.ts +++ b/src/vs/platform/theme/electron-main/themeMainService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BrowserWindow, nativeTheme } from 'electron'; +import { nativeTheme } from 'electron'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; @@ -68,19 +68,6 @@ export class ThemeMainService implements IThemeMainService { { key: THEME_WINDOW_SPLASH, data: splash } ]); - // Update in opened windows - if (typeof windowId === 'number') { - this.updateBackgroundColor(windowId, splash); - } - } - - private updateBackgroundColor(windowId: number, splash: IPartsSplash): void { - for (const window of BrowserWindow.getAllWindows()) { - if (window.id === windowId) { - window.setBackgroundColor(splash.colorInfo.background); - break; - } - } } getWindowSplash(): IPartsSplash | undefined { diff --git a/src/vs/platform/windows/electron-main/window.ts b/src/vs/platform/windows/electron-main/window.ts --- a/src/vs/platform/windows/electron-main/window.ts +++ b/src/vs/platform/windows/electron-main/window.ts @@ -157,7 +157,8 @@ width: this.windowState.width, height: this.windowState.height, x: this.windowState.x, y: this.windowState.y, - backgroundColor: this.themeMainService.getBackgroundColor(), + transparent: true, + backgroundColor: '#00000000' || this.themeMainService.getBackgroundColor(), minWidth: WindowMinimumSize.WIDTH, minHeight: WindowMinimumSize.HEIGHT, show: !isFullscreenOrMaximized, diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts --- a/src/vs/workbench/common/theme.ts 2020-04-21 11:28:02.140938188 +0800 +++ b/src/vs/workbench/common/theme.ts 2020-04-21 11:36:36.133491755 +0800 @@ -6,23 +6,25 @@ import { localize } from 'vs/nls'; import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme } from 'vs/platform/theme/common/themeService'; -import { Color } from 'vs/base/common/color'; -import { ColorScheme } from 'vs/platform/theme/common/theme'; +import { Color, RGBA } from 'vs/base/common/color'; // < --- Workbench (not customizable) --- > -export function WORKBENCH_BACKGROUND(theme: IColorTheme): Color { - switch (theme.type) { - case ColorScheme.LIGHT: - return Color.fromHex('#F3F3F3'); - case ColorScheme.HIGH_CONTRAST_LIGHT: - return Color.fromHex('#FFFFFF'); - case ColorScheme.HIGH_CONTRAST_DARK: - return Color.fromHex('#000000'); - default: - return Color.fromHex('#252526'); - } -} +export const WORKBENCH_BACKGROUND = (theme: IColorTheme) => theme.getColor( + registerColor( + 'workbench.background', + { + light: '#F3F3F3', + hcLight: '#FFFFFF', + hcDark: '#000000', + dark: '#252526' + }, + localize( + 'workbenchBackground', + 'Top-level background color. Not seen unless other elements have a transparent color.' + ) + ) +) || new Color(new RGBA(0, 0, 0, 0)); // < --- Tabs --- >