Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix acrylic brush flash/fade on new tab creation. #1092

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// enabled and no background image is present.
// - Avoids image flickering and acrylic brush redraw if settings are changed
// but the appropriate brush is still in place.
// - Does not apply background color; _BackgroundColorChanged must be called
// to do so.
// - Does not apply background color outside of acrylic mode;
// _BackgroundColorChanged must be called to do so.
// Arguments:
// - <none>
// Return Value:
Expand All @@ -223,6 +223,18 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
acrylic.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
}

// see GH#1082: Initialize background color so we don't get a
// fade/flash when _BackgroundColorChanged is called
uint32_t color = _settings.DefaultBackground();
winrt::Windows::UI::Color bgColor{};
bgColor.R = GetRValue(color);
bgColor.G = GetGValue(color);
bgColor.B = GetBValue(color);
bgColor.A = 255;

acrylic.FallbackColor(bgColor);
acrylic.TintColor(bgColor);

// Apply brush settings
acrylic.TintOpacity(_settings.TintOpacity());

Expand Down