summarylogtreecommitdiffstats
path: root/transparent.diff
blob: ea276d46a9101b3499a51baea9bc7589bfa1b38c (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
77
78
79
80
diff --git a/src/main.js b/src/main.js
index d5f4c90..5e4dba7 100644
--- 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
index b55f409..8c61319 100644
--- a/src/vs/code/electron-main/window.ts
+++ b/src/vs/code/electron-main/window.ts
@@ -122,7 +122,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
 				height: this.windowState.height,
 				x: this.windowState.x,
 				y: this.windowState.y,
-				backgroundColor: this.themeMainService.getBackgroundColor(),
+				transparent: true,
+				backgroundColor: '#00000000' || this.themeMainService.getBackgroundColor(),
 				minWidth: CodeWindow.MIN_WIDTH,
 				minHeight: CodeWindow.MIN_HEIGHT,
 				show: !isFullscreenOrMaximized,
diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts
index 188874a..5769904 100644
--- a/src/vs/workbench/common/theme.ts
+++ b/src/vs/workbench/common/theme.ts
@@ -7,20 +7,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 { Disposable } from 'vs/base/common/lifecycle';
 import { IThemeService, ITheme } 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: ITheme): 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: ITheme) => 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
index 373f411..16d74ca 100644
--- 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,