summarylogtreecommitdiffstats
path: root/transparent.diff
blob: be07c42fb336230be387a4146a072b0126ff823f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
diff --git a/src/main.js b/src/main.js
--- a/src/main.js
+++ b/src/main.js
@@ -157,6 +157,9 @@ function configureCommandlineSwitchesSync(cliArgs) {
 		}
 	});
 
+	// enable transparent
+	app.commandLine.appendSwitch('enable-transparent-visuals');
+
 	// Support JS Flags
 	const jsFlags = getJSFlags(cliArgs);
 	if (jsFlags) {
diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts
--- a/src/vs/code/electron-main/window.ts
+++ b/src/vs/code/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,20 +6,24 @@
 import * as nls from 'vs/nls';
 import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground } from 'vs/platform/theme/common/colorRegistry';
 import { IColorTheme } from 'vs/platform/theme/common/themeService';
-import { Color } from 'vs/base/common/color';
+import { Color, RGBA } from 'vs/base/common/color';

 // < --- Workbench (not customizable) --- >

-export function WORKBENCH_BACKGROUND(theme: IColorTheme): Color {
-	switch (theme.type) {
-		case 'dark':
-			return Color.fromHex('#252526');
-		case 'light':
-			return Color.fromHex('#F3F3F3');
-		default:
-			return Color.fromHex('#000000');
-	}
-}
+export const WORKBENCH_BACKGROUND = (theme: IColorTheme) => theme.getColor(
+	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.'
+		)
+	)
+) || new Color(new RGBA(0, 0, 0, 0));
 
 // < --- Tabs --- >
 
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
--- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
@@ -466,6 +466,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
 			macOptionIsMeta: config.macOptionIsMeta,
 			macOptionClickForcesSelection: config.macOptionClickForcesSelection,
 			rightClickSelectsWord: config.rightClickBehavior === 'selectWord',
+			allowTransparency: true,
 			fastScrollModifier: 'alt',
 			fastScrollSensitivity: editorOptions.fastScrollSensitivity,
 			scrollSensitivity: editorOptions.mouseWheelScrollSensitivity,