diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp index d1388214a5f..b4f6a87a189 100644 --- a/src/cascadia/TerminalControl/ControlCore.cpp +++ b/src/cascadia/TerminalControl/ControlCore.cpp @@ -601,13 +601,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation // Update our runtime opacity value _runtimeOpacity = newOpacity; - // GH#11285 - If the user is on Windows 10, and they changed the - // transparency of the control s.t. it should be partially opaque, then - // opt them in to acrylic. It's the only way to have transparency on - // Windows 10. - // We'll also turn the acrylic back off when they're fully opaque, which - // is what the Terminal did prior to 1.12. - _runtimeUseAcrylic = newOpacity < 1.0 && (!IsVintageOpacityAvailable() || _settings->UseAcrylic()); + // Manually turn off acrylic if they turn off transparency. + _runtimeUseAcrylic = newOpacity < 1.0 && _settings->UseAcrylic(); // Update the renderer as well. It might need to fall back from // cleartype -> grayscale if the BG is transparent / acrylic. @@ -733,13 +728,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation auto lock = _terminal->LockForWriting(); - // GH#11285 - If the user is on Windows 10, and they wanted opacity, but - // didn't explicitly request acrylic, then opt them in to acrylic. - // On Windows 11+, this isn't needed, because we can have vintage opacity. - // Instead, disable acrylic while the opacity is 100% - _runtimeUseAcrylic = _settings->Opacity() < 1.0 && (!IsVintageOpacityAvailable() || _settings->UseAcrylic()); _runtimeOpacity = std::nullopt; + // Manually turn off acrylic if they turn off transparency. + _runtimeUseAcrylic = _settings->Opacity() < 1.0 && _settings->UseAcrylic(); + const auto sizeChanged = _setFontSizeUnderLock(_settings->FontSize()); // Update the terminal core with its new Core settings @@ -1753,22 +1746,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation return hstring{ str }; } - // Helper to check if we're on Windows 11 or not. This is used to check if - // we need to use acrylic to achieve transparency, because vintage opacity - // doesn't work in islands on win10. - // Remove when we can remove the rest of GH#11285 - bool ControlCore::IsVintageOpacityAvailable() noexcept - { - OSVERSIONINFOEXW osver{}; - osver.dwOSVersionInfoSize = sizeof(osver); - osver.dwBuildNumber = 22000; - - DWORDLONG dwlConditionMask = 0; - VER_SET_CONDITION(dwlConditionMask, VER_BUILDNUMBER, VER_GREATER_EQUAL); - - return VerifyVersionInfoW(&osver, VER_BUILDNUMBER, dwlConditionMask) != FALSE; - } - Core::Scheme ControlCore::ColorScheme() const noexcept { Core::Scheme s; diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp index fadf3d0a6b6..1cae80224e1 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp @@ -51,22 +51,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation // NOTE: this is similar to what is done with BackgroundImagePath above _NotifyChanges(L"UseParentProcessDirectory", L"UseCustomStartingDirectory"); } - else if (viewModelProperty == L"UseAcrylic") - { - // GH#11372: If we're on Windows 10, and someone turns off - // acrylic, we're going to disable opacity for them. Opacity - // doesn't work without acrylic on Windows 10. - // - // BODGY: CascadiaSettings's function IsDefaultTerminalAvailable - // is basically a "are we on Windows 11" check, because defterm - // only works on Win11. So we'll use that. - // - // Remove when we can remove the rest of GH#11285 - if (!UseAcrylic() && !CascadiaSettings::IsDefaultTerminalAvailable()) - { - Opacity(1.0); - } - } else if (viewModelProperty == L"AntialiasingMode") { _NotifyChanges(L"CurrentAntiAliasingMode"); diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h index 1b61c7062c7..81c8cf4d00e 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h @@ -35,21 +35,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void SetAcrylicOpacityPercentageValue(double value) { Opacity(winrt::Microsoft::Terminal::Settings::Editor::Converters::PercentageValueToPercentage(value)); - - // GH#11372: If we're on Windows 10, and someone wants opacity, then - // we'll turn acrylic on for them. Opacity doesn't work without - // acrylic on Windows 10. - // - // BODGY: CascadiaSettings's function IsDefaultTerminalAvailable - // is basically a "are we on Windows 11" check, because defterm - // only works on Win11. So we'll use that. - // - // Remove when we can remove the rest of GH#11285 - if (value < 100.0 && - !winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings::IsDefaultTerminalAvailable()) - { - UseAcrylic(true); - } }; void SetPadding(double value) diff --git a/src/cascadia/UnitTests_Control/ControlCoreTests.cpp b/src/cascadia/UnitTests_Control/ControlCoreTests.cpp index f2d3aba2f88..63f93cdb910 100644 --- a/src/cascadia/UnitTests_Control/ControlCoreTests.cpp +++ b/src/cascadia/UnitTests_Control/ControlCoreTests.cpp @@ -143,8 +143,8 @@ namespace ControlUnitTests // requested acrylic. auto expectedUseAcrylic = expectedOpacity < 1.0; + VERIFY_IS_TRUE(core->_settings->UseAcrylic()); VERIFY_ARE_EQUAL(expectedUseAcrylic, core->UseAcrylic()); - VERIFY_ARE_EQUAL(true, core->_settings->UseAcrylic()); }; core->TransparencyChanged(opacityCallback); diff --git a/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp b/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp index 560e8b27a49..5a1225d8335 100644 --- a/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp +++ b/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp @@ -145,7 +145,7 @@ namespace ControlUnitTests VERIFY_ARE_EQUAL(0.5, settings->Opacity()); auto expectedUseAcrylic = expectedOpacity < 1.0 && - (!winrt::Microsoft::Terminal::Control::implementation::ControlCore::IsVintageOpacityAvailable() || useAcrylic); + (useAcrylic); VERIFY_ARE_EQUAL(useAcrylic, settings->UseAcrylic()); VERIFY_ARE_EQUAL(expectedUseAcrylic, core->UseAcrylic()); };