Improve Accessibility Reliability (#2609)
* Remove WindowUiaProvider entry points Make TerminalAutomationPeer not crash the app if creation failed. * code format * prefer universal initialization Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
This commit is contained in:
parent
bfb1484708
commit
6b415126fd
|
@ -342,9 +342,15 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
|||
|
||||
Windows::UI::Xaml::Automation::Peers::AutomationPeer TermControl::OnCreateAutomationPeer()
|
||||
{
|
||||
// create a custom automation peer with this code pattern:
|
||||
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
|
||||
return winrt::make<winrt::Microsoft::Terminal::TerminalControl::implementation::TermControlAutomationPeer>(*this);
|
||||
Windows::UI::Xaml::Automation::Peers::AutomationPeer autoPeer{ nullptr };
|
||||
try
|
||||
{
|
||||
// create a custom automation peer with this code pattern:
|
||||
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
|
||||
autoPeer = winrt::make<winrt::Microsoft::Terminal::TerminalControl::implementation::TermControlAutomationPeer>(*this);
|
||||
}
|
||||
CATCH_LOG();
|
||||
return autoPeer;
|
||||
}
|
||||
|
||||
::Microsoft::Console::Types::IUiaData* TermControl::GetUiaData() const
|
||||
|
|
|
@ -56,13 +56,24 @@ public:
|
|||
return HandleDpiChange(_window.get(), wparam, lparam);
|
||||
}
|
||||
|
||||
// TODO GitHub #2447: Properly attach WindowUiaProvider for signaling model
|
||||
/*
|
||||
case WM_GETOBJECT:
|
||||
{
|
||||
return HandleGetObject(_window.get(), wparam, lparam);
|
||||
}
|
||||
*/
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
// TODO GitHub #2447: Properly attach WindowUiaProvider for signaling model
|
||||
/*
|
||||
// signal to uia that they can disconnect our uia provider
|
||||
if (_pUiaProvider)
|
||||
{
|
||||
UiaReturnRawElementProvider(hWnd, 0, 0, NULL);
|
||||
}
|
||||
*/
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -161,6 +161,16 @@ void IslandWindow::OnSize(const UINT width, const UINT height)
|
|||
{
|
||||
if (_interopWindowHandle != nullptr)
|
||||
{
|
||||
// TODO GitHub #2447: Properly attach WindowUiaProvider for signaling model
|
||||
/*
|
||||
// set the text area to have focus for accessibility consumers
|
||||
if (_pUiaProvider)
|
||||
{
|
||||
LOG_IF_FAILED(_pUiaProvider->SetTextAreaFocus());
|
||||
}
|
||||
break;
|
||||
*/
|
||||
|
||||
// send focus to the child window
|
||||
SetFocus(_interopWindowHandle);
|
||||
return 0; // eat the message
|
||||
|
|
Loading…
Reference in a new issue