From d87772843a40b44cc4c4eaa92f5fec6dec6a4a93 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 2 Nov 2026 11:35:54 -0600 Subject: [PATCH] Fix the useAcrylicInTabRow flicker (#20881) This PR fixes the flicker in the tab row when you've got: ```jsonc { "showTabsInTitlebar": true, "useAcrylicInTabRow": true, "compatibility.enableUnfocusedAcrylic": true, "profiles": { "defaults": { "useAcrylic": true, "opacity": 80 } } } ``` For historical reference: - #10864 - merged **August 23, 2021.** Added `useAcrylicInTabRow`, with a separate tab-row brush hardcoded to `HostBackdrop`. - #11180 - merged **September 20, 2021.** Added transparent window backgrounds. This removed the XAML opaque backstop and enabled the later in-app acrylic approach. - #15923 - merged **September 7, 2023.** Added `compatibility.enableUnfocusedAcrylic`, defaulting to true, and switched `TermControl` to `Backdrop`. **It did not update the separate tab-row brush in `TerminalPage`**. This is when the bug showed up. We don't need a HWND to bounce foreground off of. We don't need to recycle brushes. We just need to know that we now support both HostBackdrop acrylic, XOR in-app Backdrop acrylic, and make sure to not try to use both at the same time. Closes #14384 Closes #20316 Closes #20293 Closes #19705 I'm out. (cherry picked from commit f472aa97c143e3491b01e822e5bae585441c5a98) Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zhFdkss Service-Version: 1.25 --- src/cascadia/TerminalApp/TerminalPage.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index fd44251245..ab7b83bb65 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -4935,7 +4935,11 @@ namespace winrt::TerminalApp::implementation } const auto acrylicBrush = Media::AcrylicBrush(); - acrylicBrush.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop); + // Make sure that we use the same backdrop source as TermControl. + // If we don't, it'll cause the same flickering as in GH #14384 + acrylicBrush.BackgroundSource(_currentWindowSettings().EnableUnfocusedAcrylic() ? + Media::AcrylicBackgroundSource::Backdrop : + Media::AcrylicBackgroundSource::HostBackdrop); acrylicBrush.FallbackColor(bgColor); acrylicBrush.TintColor(bgColor); acrylicBrush.TintOpacity(0.5);