Skip to content

Commit

Permalink
hey there buddy, did you get lost?
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 19, 2024
1 parent a7533fa commit 826fc08
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/cascadia/TerminalApp/Pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class Pane : public std::enable_shared_from_this<Pane>

WINRT_CALLBACK(GotFocus, gotFocusArgs);
WINRT_CALLBACK(LostFocus, winrt::delegate<std::shared_ptr<Pane>>);
WINRT_CALLBACK(PaneRaiseBell, winrt::Windows::Foundation::EventHandler<bool>);
WINRT_CALLBACK(Detached, winrt::delegate<std::shared_ptr<Pane>>);

private:
Expand Down
27 changes: 27 additions & 0 deletions src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,33 @@ namespace winrt::TerminalApp::implementation
}
});

events.BellRequested = content.BellRequested(
winrt::auto_revoke,
[dispatcher, weakThis](TerminalApp::IPaneContent sender, auto bellArgs) -> winrt::fire_and_forget {
const auto weakThisCopy = weakThis;
co_await wil::resume_foreground(dispatcher);
if (const auto tab{ weakThisCopy.get() })
{
if (bellArgs.FlashTaskbar())
{
// 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();
}

// 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 (_tabStatus.IsInputBroadcastActive())
{
if (const auto& termContent{ content.try_as<TerminalApp::TerminalPaneContent>() })
Expand Down
1 change: 0 additions & 1 deletion src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// (The window has a min. size that ensures that there's always a scrollbar thumb.)
if (drawableRange < 0)
{
assert(false);
return;
}

Expand Down

0 comments on commit 826fc08

Please sign in to comment.