Notify UIA when Search finds something (#5478)

## Summary of the Pull Request
Before this, if the Search Box was open, new selections would not notify automation clients. This was because the UiaEngine (responsible for notifying automation clients) would remain disabled. Now we're enabling it before the early exit in TermControl's FocusHandler

## PR Checklist
* [X] Will close issue #5421 upon verification

## Validation Steps Performed
Verified using NVDA.
Narrator's behavior is not impacted, for some reason.
This commit is contained in:
Carlos Zamora 2020-04-29 10:36:45 -07:00 committed by GitHub
parent db5d2fe0a5
commit 6d4107206a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1548,6 +1548,13 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
InputPane::GetForCurrentView().TryShow();
// GH#5421: Enable the UiaEngine before checking for the SearchBox
// That way, new selections are notified to automation clients.
if (_uiaEngine.get())
{
THROW_IF_FAILED(_uiaEngine->Enable());
}
// If the searchbox is focused, we don't want TSFInputControl to think
// it has focus so it doesn't intercept IME input. We also don't want the
// terminal's cursor to start blinking. So, we'll just return quickly here.
@ -1556,11 +1563,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
return;
}
if (_uiaEngine.get())
{
THROW_IF_FAILED(_uiaEngine->Enable());
}
if (TSFInputControl() != nullptr)
{
TSFInputControl().NotifyFocusEnter();