Repository navigation
Conversation
Use top-level window activation to control Acrylic fallback and keep the tab row, terminal panes, and settings previews on the same backdrop source. Refs microsoft#20944
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@microsoft-github-policy-service agree |
|
What differentiates this PR from #20881? What makes this the right solution to this problem? Would other approaches work too? Why this change and not some other approach? |
Thanks for review! What differentiates this PR from #20881#20881 fixed mixed-source flicker for #20944 reproduces on Preview 1.26.3133.0 (already includes #20881) with
So this PR moves Terminal's own controls off Why this approach
note: I drafted this reply in Chinese, and used llm to translate, tighten the English wording and markdown formatting. |
Summary of the Pull Request
Replaces reliance on
AcrylicBackgroundSource::HostBackdropfor unfocused acrylic fallback with explicit top-level window activation tracking, keeping the tab row, terminal panes, and Settings preview controls onAcrylicBackgroundSource::Backdrop.References and Relevant Issues
#20944
Detailed Description of the Pull Request / Additional comments
In XAML Islands,
AcrylicBackgroundSource::HostBackdropcan misreport window activation state, leading to inverted acrylic states when switching focus between multiple Terminal windows and full-window flickering when hovering over the tab row withEnableUnfocusedAcrylicdisabled.This change switches acrylic fallback to be driven directly by top-level window activation:
TermControl.idl,TermControl.h,TermControl.cpp:WindowActivationChanged(Boolean activated)and tracks host-provided activation state instd::optional<bool> _windowActivated.AcrylicBackgroundSource::Backdropwhenever_windowActivated.has_value()orEnableUnfocusedAcrylic()is enabled, while preserving the existingHostBackdropbehavior for external hosts that do not callWindowActivationChanged.AcrylicBrush::AlwaysUseFallback(_ShouldUseAcrylicFallback())and recreates theAcrylicBrushif itsBackgroundSourcechanges.TerminalPage.cpp:_activatedto controls in_SetupControl(covering both newly created and attached/moved panes) and propagates changes across all terminal panes inWindowActivated.AcrylicBrushin_updateThemeColorsonBackdrop, since_updateThemeColorsalready swaps to a solid/theme brush when the window is inactive andEnableUnfocusedAcrylicis disabled.TerminalSettings.cpp:_EnableUnfocusedAcrylic = trueinCreateForPreviewand delegatesCreateForPreviewUnfocusedtoCreateForPreviewso preview controls—which are not driven byWindowActivationChanged—stay onBackdropinstead of mixing inHostBackdrop.AI-use: used AI (Codex + 6.2-Astra) for investigating this bug fix and translation. Tested myself.
Validation Steps Performed
VID_20261121154557.mp4
PR Checklist