From d25ca26142de99fcd4964a6cce90fd9fb935cfc4 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Wed, 29 Sep 2021 16:55:44 -0500 Subject: [PATCH] Always init the BG opacity with the renderer (#11368) Missed this in #11180. I forgot to init the BG opacity with the renderer on startup, because that matters when you have `"antialiasingMode": "cleartype",`. Repro json ```json { "commandline": "cmd.exe", "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "hidden": false, "opacity": 35, "antialiasingMode": "cleartype", "padding": "0", "name": "Command Prompt" }, ``` * [x] Fixes #11315 --- src/cascadia/TerminalControl/ControlCore.cpp | 6 ++---- src/cascadia/TerminalControl/TermControl.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp index 534862698..efcce89c8 100644 --- a/src/cascadia/TerminalControl/ControlCore.cpp +++ b/src/cascadia/TerminalControl/ControlCore.cpp @@ -274,10 +274,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation _updateAntiAliasingMode(_renderEngine.get()); // GH#5098: Inform the engine of the opacity of the default text background. - if (_settings.UseAcrylic()) - { - _renderEngine->SetDefaultTextBackgroundOpacity(::base::saturated_cast(_settings.Opacity())); - } + // GH#11315: Always do this, even if they don't have acrylic on. + _renderEngine->SetDefaultTextBackgroundOpacity(::base::saturated_cast(_settings.Opacity())); THROW_IF_FAILED(_renderEngine->Enable()); diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index f90190a5d..32bd45f6b 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -459,7 +459,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation } // GH#5098: Inform the engine of the new opacity of the default text background. - _core.SetBackgroundOpacity(::base::saturated_cast(appearance.Opacity())); + _core.SetBackgroundOpacity(appearance.Opacity()); } else {