From da5ec7b2a2ce00b160ecb100b61e3cbb6821bf6c Mon Sep 17 00:00:00 2001 From: PankajBhojwani Date: Fri, 19 Feb 2021 10:21:35 -0800 Subject: [PATCH] Always show the bell indicator when BEL is emitted (#9212) Regardless of whether the bellstyle is set to visual, show the bell indicator in the tab header (cherry picked from commit d12a71cdf946c2180f15280dafc98c80ffe7dfc2) --- src/cascadia/TerminalApp/TerminalTab.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/cascadia/TerminalApp/TerminalTab.cpp b/src/cascadia/TerminalApp/TerminalTab.cpp index 15727c49f07..d0164488531 100644 --- a/src/cascadia/TerminalApp/TerminalTab.cpp +++ b/src/cascadia/TerminalApp/TerminalTab.cpp @@ -709,25 +709,26 @@ namespace winrt::TerminalApp::implementation } }); - // Add a PaneRaiseVisualBell event handler to the Pane. When the pane emits this event, - // we need to bubble it all the way to app host. In this part of the chain we bubble it - // from the hosting tab to the page. + // Add a PaneRaiseBell event handler to the Pane pane->PaneRaiseBell([weakThis](auto&& /*s*/, auto&& visual) { if (auto tab{ weakThis.get() }) { if (visual) { + // If visual is set, we need to bubble this event all the way to app host to flash the taskbar + // In this part of the chain we bubble it from the hosting tab to the page tab->_TabRaiseVisualBellHandlers(); + } - tab->ShowBellIndicator(true); + // Show the bell indicator in the tab header + tab->ShowBellIndicator(true); - // If this tab is focused, activate the bell indicator timer, which will - // remove the bell indicator once it fires - // (otherwise, the indicator is removed when the tab gets focus) - if (tab->_focusState != WUX::FocusState::Unfocused) - { - tab->ActivateBellIndicatorTimer(); - } + // If this tab is focused, activate the bell indicator timer, which will + // remove the bell indicator once it fires + // (otherwise, the indicator is removed when the tab gets focus) + if (tab->_focusState != WUX::FocusState::Unfocused) + { + tab->ActivateBellIndicatorTimer(); } } });