Skip to content

Commit

Permalink
More piping...
Browse files Browse the repository at this point in the history
  • Loading branch information
miniksa committed Feb 15, 2022
1 parent 8d24f23 commit 48e37a5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cascadia/TerminalControl/ControlCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
auto pfnTerminalTaskbarProgressChanged = std::bind(&ControlCore::_terminalTaskbarProgressChanged, this);
_terminal->TaskbarProgressChangedCallback(pfnTerminalTaskbarProgressChanged);

auto pfnShowWindowChanged = [&](bool foo){ foo;};
_terminal->SetShowWindowCallback(pfnShowWindowChanged);

// MSFT 33353327: Initialize the renderer in the ctor instead of Initialize().
// We need the renderer to be ready to accept new engines before the SwapChainPanel is ready to go.
// If we wait, a screen reader may try to get the AutomationPeer (aka the UIA Engine), and we won't be able to attach
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/TerminalCore/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,11 @@ void Microsoft::Terminal::Core::Terminal::TaskbarProgressChangedCallback(std::fu
_pfnTaskbarProgressChanged.swap(pfn);
}

void Terminal::SetShowWindowCallback(std::function<void(bool)> pfn) noexcept
{
_pfnShowWindowChanged.swap(pfn);
}

// Method Description:
// - Sets the cursor to be currently on. On/Off is tracked independently of
// cursor visibility (hidden/visible). On/off is controlled by the cursor
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalCore/Terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class Microsoft::Terminal::Core::Terminal final :
void SetCursorPositionChangedCallback(std::function<void()> pfn) noexcept;
void SetBackgroundCallback(std::function<void(const til::color)> pfn) noexcept;
void TaskbarProgressChangedCallback(std::function<void()> pfn) noexcept;
void SetShowWindowCallback(std::function<void(bool)> pfn) noexcept;

void SetCursorOn(const bool isOn);
bool IsCursorBlinkingAllowed() const noexcept;
Expand Down Expand Up @@ -274,6 +275,7 @@ class Microsoft::Terminal::Core::Terminal final :
std::function<void()> _pfnCursorPositionChanged;
std::function<void(const std::optional<til::color>)> _pfnTabColorChanged;
std::function<void()> _pfnTaskbarProgressChanged;
std::function<void(bool)> _pfnShowWindowChanged;

RenderSettings _renderSettings;
std::unique_ptr<::Microsoft::Console::VirtualTerminal::StateMachine> _stateMachine;
Expand Down
5 changes: 4 additions & 1 deletion src/cascadia/TerminalCore/TerminalApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,5 +579,8 @@ void Terminal::PopGraphicsRendition()
// - <none>
void Terminal::ShowWindow(bool showOrHide)
{
showOrHide;
if (_pfnShowWindowChanged)
{
_pfnShowWindowChanged(showOrHide);
}
}

1 comment on commit 48e37a5

@github-actions

This comment was marked as outdated.

Please sign in to comment.