Skip to content

Commit

Permalink
Reduce CursorChanged Events for Accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Mar 30, 2020
1 parent ca6b54e commit 8403a76
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,11 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
if (!_closing.load())
{
TSFInputControl().TryRedrawCanvas();

if (_uiaEngine.get())
{
_uiaEngine->CursorPositionChanged();
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/uia/UiaRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ UiaEngine::UiaEngine(IUiaEventDispatcher* dispatcher) :
// - S_FALSE
[[nodiscard]] HRESULT UiaEngine::InvalidateCursor(const COORD* const /*pcoordCursor*/) noexcept
{
_cursorChanged = true;
return S_FALSE;
}

Expand Down Expand Up @@ -454,6 +453,11 @@ UiaEngine::UiaEngine(IUiaEventDispatcher* dispatcher) :
return S_FALSE;
}

void UiaEngine::CursorPositionChanged() noexcept
{
_cursorChanged = true;
}

// Method Description:
// - Updates the window's title string.
// - Currently unused by this renderer.
Expand Down
1 change: 1 addition & 0 deletions src/renderer/uia/UiaRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace Microsoft::Console::Render
[[nodiscard]] HRESULT GetFontSize(_Out_ COORD* const pFontSize) noexcept override;
[[nodiscard]] HRESULT IsGlyphWideByFont(const std::wstring_view glyph, _Out_ bool* const pResult) noexcept override;

void CursorPositionChanged() noexcept;
protected:
[[nodiscard]] HRESULT _DoUpdateTitle(const std::wstring& newTitle) noexcept override;

Expand Down

0 comments on commit 8403a76

Please sign in to comment.