This too didn't work. Creating the XAML thing not on the XAML thing isn't going to work
This commit is contained in:
parent
3a0fbd9f59
commit
fd364db727
|
@ -1484,4 +1484,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
_updatePatternLocations->Run();
|
||||
}
|
||||
|
||||
winrt::Windows::System::DispatcherQueue ControlCore::Dispatcher()
|
||||
{
|
||||
return _dispatcher;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,6 +144,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
bool IsInReadOnlyMode() const;
|
||||
void ToggleReadOnlyMode();
|
||||
|
||||
winrt::Windows::System::DispatcherQueue Dispatcher();
|
||||
|
||||
// -------------------------------- WinRT Events ---------------------------------
|
||||
// clang-format off
|
||||
WINRT_CALLBACK(FontSizeChanged, Control::FontSizeChangedEventArgs);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "ControlInteractivity.g.cpp"
|
||||
#include "TermControl.h"
|
||||
#include <til/latch.h>
|
||||
|
||||
using namespace ::Microsoft::Console::Types;
|
||||
using namespace ::Microsoft::Console::VirtualTerminal;
|
||||
|
@ -614,11 +615,21 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
Control::InteractivityAutomationPeer ControlInteractivity::OnCreateAutomationPeer()
|
||||
try
|
||||
{
|
||||
auto autoPeer = winrt::make_self<implementation::InteractivityAutomationPeer>(this);
|
||||
til::latch latch{ 1 };
|
||||
Control::InteractivityAutomationPeer peer{ nullptr };
|
||||
|
||||
_uiaEngine = std::make_unique<::Microsoft::Console::Render::UiaEngine>(autoPeer.get());
|
||||
_core->AttachUiaEngine(_uiaEngine.get());
|
||||
return *autoPeer;
|
||||
_core->Dispatcher().TryEnqueue([this, &peer, &latch]() {
|
||||
auto autoPeer = winrt::make_self<implementation::InteractivityAutomationPeer>(this);
|
||||
|
||||
_uiaEngine = std::make_unique<::Microsoft::Console::Render::UiaEngine>(autoPeer.get());
|
||||
_core->AttachUiaEngine(_uiaEngine.get());
|
||||
|
||||
peer = *autoPeer;
|
||||
latch.count_down();
|
||||
});
|
||||
|
||||
latch.wait();
|
||||
return peer;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue