From 2f757d88db22dfd649d457c3f3696e96ee9afcd4 Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Tue, 8 Feb 2022 12:06:45 +0530 Subject: [PATCH] Revert "Allow transparent backgrounds in webgl" This reverts commit 2e8e2af15f70c748fce36a8d5ff3eb6d770d25ca. --- lib/components/term.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/components/term.tsx b/lib/components/term.tsx index f0e56a6d..16846184 100644 --- a/lib/components/term.tsx +++ b/lib/components/term.tsx @@ -131,9 +131,15 @@ export default class Term extends React.PureComponent { this.termWrapperRef?.appendChild(this.termRef); if (!props.term) { + const needTransparency = Color(props.backgroundColor).alpha() < 1; let useWebGL = false; if (props.webGLRenderer) { - if (!isWebgl2Supported()) { + if (needTransparency) { + console.warn( + 'WebGL Renderer has been disabled since it does not support transparent backgrounds yet. ' + + 'Falling back to canvas-based rendering.' + ); + } else if (!isWebgl2Supported()) { console.warn('WebGL2 is not supported on your machine. Falling back to canvas-based rendering.'); } else { // Experimental WebGL renderer needs some more glue-code to make it work on Hyper.