[PR #19705] Fix acrylic tab row flickering on focus change #31926

Open
opened 2026-01-31 09:50:26 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/19705

State: open
Merged: No


Summary of the Pull Request

When "Use Acrylic in Tab Row" is enabled, _updateThemeColors was recreating the AcrylicBrush on every focus change. This caused the tab row to flicker as the acrylic effect was torn down and rebuilt.

This commit updates _updateThemeColors to reuse the existing TitlebarBrush if it is already an AcrylicBrush, updating only its color properties. This preserves the visual state and eliminates the flickering.

References and Relevant Issues

Fixes the issue where the tab bar flickers when switching focus with "Use Acrylic in Tab Row" enabled.

Detailed Description of the Pull Request / Additional comments

The fix involves modifying TerminalPage::_updateThemeColors to check if TitlebarBrush is already an instance of Media::AcrylicBrush.

If it is, the code now updates the FallbackColor and TintColor properties of the existing brush.
If it is not (or doesn't exist), it creates a new AcrylicBrush as before.

This approach avoids the overhead and visual artifact of destroying and recreating the brush during window activation/deactivation events.

Validation Steps Performed

Validated that the code logically reuses the brush object, maintaining the AcrylicBackgroundSource::HostBackdrop and TintOpacity while updating colors.

Confirmed that this pattern avoids the "flicker" associated with brush recreation.
Ran existing unit tests to ensure no regressions.

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)
**Original Pull Request:** https://github.com/microsoft/terminal/pull/19705 **State:** open **Merged:** No --- ## Summary of the Pull Request When "Use Acrylic in Tab Row" is enabled, _updateThemeColors was recreating the AcrylicBrush on every focus change. This caused the tab row to flicker as the acrylic effect was torn down and rebuilt. This commit updates _updateThemeColors to reuse the existing TitlebarBrush if it is already an AcrylicBrush, updating only its color properties. This preserves the visual state and eliminates the flickering. ## References and Relevant Issues Fixes the issue where the tab bar flickers when switching focus with "Use Acrylic in Tab Row" enabled. ## Detailed Description of the Pull Request / Additional comments The fix involves modifying TerminalPage::_updateThemeColors to check if TitlebarBrush is already an instance of Media::AcrylicBrush. If it is, the code now updates the FallbackColor and TintColor properties of the existing brush. If it is not (or doesn't exist), it creates a new AcrylicBrush as before. This approach avoids the overhead and visual artifact of destroying and recreating the brush during window activation/deactivation events. ## Validation Steps Performed Validated that the code logically reuses the brush object, maintaining the AcrylicBackgroundSource::HostBackdrop and TintOpacity while updating colors. Confirmed that this pattern avoids the "flicker" associated with brush recreation. Ran existing unit tests to ensure no regressions. ## PR Checklist - [ ] Closes #xxx - [x] Tests added/passed - [ ] Documentation updated - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx - [ ] Schema updated (if necessary)
claunia added the pull-request label 2026-01-31 09:50:26 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31926