From 90c92850ea8257c4bfb0ff5689d6cb0e2e12037e Mon Sep 17 00:00:00 2001 From: David Machaj <46852402+dmachaj@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:28:15 -0700 Subject: [PATCH] Convert WIL submodule to global NuGet. Update to latest. Replace winrt::resume_foreground with wil::resume_foreground (#12778) ## Summary of the Pull Request This builds on top of #12707. As I understand it the primary motivation for using a git submodule instead of NuGet is just that it is too annoying to have to manage dozens of packages.config files and their corresponding import statements. Now that there is a single global nuget definition that is a nonissue and we can switch over. This also updates to the latest version of WIL. Now that the latest version of WIL is available it uses it to replace `winrt::resume_foreground` with `wil::resume_foreground`. See [https://github.com/microsoft/wil/commit/492c01bb535daadf719d4445d6107aadf1e60812](https://github.com/microsoft/wil/commit/492c01bb535daadf719d4445d6107aadf1e60812) for a detailed explanation of the problems with `winrt::resume_foreground` and how WIL addresses them. ## References ## PR Checklist * [ ] Closes #12776, Closes #12777 * [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed Ran `git clean -fdx` to wipe my clone to be completely clean. Opened the solution in Visual Studio 2022 and build it. Used `razzle.cmd`, `b`, and `runut.cmd` to run the tests. --- dep/nuget/packages.config | 1 + dep/wil | 1 - doc/building.md | 11 +++++++++- src/buffer/out/lib/bufferout.vcxproj | 2 ++ src/cascadia/ElevateShim/elevate-shim.vcxproj | 2 ++ .../PublicTerminalCore.vcxproj | 2 ++ src/cascadia/TerminalApp/Pane.cpp | 4 ++-- src/cascadia/TerminalApp/SettingsTab.cpp | 2 +- src/cascadia/TerminalApp/TabBase.cpp | 2 +- src/cascadia/TerminalApp/TabManagement.cpp | 2 +- src/cascadia/TerminalApp/TerminalPage.cpp | 20 +++++++++---------- src/cascadia/TerminalApp/TerminalTab.cpp | 20 +++++++++---------- src/cascadia/TerminalApp/pch.h | 1 + src/cascadia/TerminalControl/TermControl.cpp | 16 +++++++-------- src/cascadia/TerminalControl/pch.h | 1 + src/cascadia/TerminalSettingsModel/pch.h | 1 + src/cascadia/WindowsTerminal/AppHost.cpp | 6 +++--- src/cascadia/WindowsTerminal/IslandWindow.cpp | 2 +- src/cascadia/WindowsTerminal/pch.h | 1 + src/cascadia/wt/wt.vcxproj | 2 ++ src/common.build.pre.props | 4 ++-- src/common.nugetversions.targets | 6 ++++++ src/host/exe/Host.EXE.vcxproj | 2 ++ src/host/lib/hostlib.vcxproj | 2 ++ .../base/lib/InteractivityBase.vcxproj | 2 ++ src/interactivity/win32/lib/win32.LIB.vcxproj | 2 ++ src/internal/internal.vcxproj | 2 ++ src/propsheet/propsheet.vcxproj | 2 ++ src/propslib/propslib.vcxproj | 2 ++ src/renderer/atlas/atlas.vcxproj | 4 +++- src/renderer/base/lib/base.vcxproj | 2 ++ src/renderer/dx/lib/dx.vcxproj | 2 ++ src/renderer/gdi/lib/gdi.vcxproj | 2 ++ src/renderer/uia/lib/uia.vcxproj | 2 ++ src/renderer/vt/lib/vt.vcxproj | 2 ++ src/server/lib/server.vcxproj | 2 ++ src/terminal/adapter/lib/adapter.vcxproj | 4 +++- src/terminal/input/lib/terminalinput.vcxproj | 4 +++- src/terminal/parser/lib/parser.vcxproj | 2 ++ src/tools/buffersize/buffersize.vcxproj | 2 ++ src/tools/echokey/ConEchoKey.vcxproj | 2 ++ src/tools/fontlist/FontList.vcxproj | 2 ++ src/tools/vtpipeterm/VtPipeTerm.vcxproj | 2 ++ src/tsf/tsf.vcxproj | 2 ++ src/types/lib/types.vcxproj | 2 ++ src/winconpty/dll/winconptydll.vcxproj | 2 ++ src/winconpty/lib/winconptylib.vcxproj | 4 +++- 47 files changed, 122 insertions(+), 45 deletions(-) delete mode 160000 dep/wil diff --git a/dep/nuget/packages.config b/dep/nuget/packages.config index fb81204984..5d0f1f2e63 100644 --- a/dep/nuget/packages.config +++ b/dep/nuget/packages.config @@ -11,6 +11,7 @@ + diff --git a/dep/wil b/dep/wil deleted file mode 160000 index 2e225973d6..0000000000 --- a/dep/wil +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2e225973d6c2ecf17fb4d376ddbeedb6db7dd82f diff --git a/doc/building.md b/doc/building.md index df13e5d693..ca88a52bcb 100644 --- a/doc/building.md +++ b/doc/building.md @@ -64,7 +64,16 @@ Openconsole has three configuration types: AuditMode is an experimental mode that enables some additional static analysis from CppCoreCheck. -## Updating Nuget package references +## Updating Nuget package references - Globally versioned +Most Nuget package references in this project are centralized in a single configuration so that there is a single canonical version for everything. This canonical version is restored before builds by the build pipeline, environment initialization scripts, or Visual Studio (as appropriate). + +The canonical version numbers are defined in dep/nuget/packages.config. That defines what will be downloaded by nuget.exe. Most Nuget packages also have a .props and/or .targets file that must be imported by every project that consumes it. Those import statements are consolidated in: +- src/common.nugetversions.props +- src/common.nugetversions.targets + +When a globally managed version changes all three of those files must be changed in unison. + +## Updating Nuget package references - Locally versioned Certain Nuget package references in this project, like `Microsoft.UI.Xaml`, must be updated outside of the Visual Studio NuGet package manager. This can be done using the snippet below. > Note that to run this snippet, you need to use WSL as the command uses `sed`. To update the version of a given package, use the following snippet diff --git a/src/buffer/out/lib/bufferout.vcxproj b/src/buffer/out/lib/bufferout.vcxproj index cfe899c732..7f48bb3fee 100644 --- a/src/buffer/out/lib/bufferout.vcxproj +++ b/src/buffer/out/lib/bufferout.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -56,4 +57,5 @@ + diff --git a/src/cascadia/ElevateShim/elevate-shim.vcxproj b/src/cascadia/ElevateShim/elevate-shim.vcxproj index f81353ad36..ba12ddf62f 100644 --- a/src/cascadia/ElevateShim/elevate-shim.vcxproj +++ b/src/cascadia/ElevateShim/elevate-shim.vcxproj @@ -11,6 +11,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/src/cascadia/PublicTerminalCore/PublicTerminalCore.vcxproj b/src/cascadia/PublicTerminalCore/PublicTerminalCore.vcxproj index a7063bb9b2..342dac89ac 100644 --- a/src/cascadia/PublicTerminalCore/PublicTerminalCore.vcxproj +++ b/src/cascadia/PublicTerminalCore/PublicTerminalCore.vcxproj @@ -9,6 +9,7 @@ DynamicLibrary + Create @@ -48,6 +49,7 @@ + diff --git a/src/cascadia/TerminalApp/Pane.cpp b/src/cascadia/TerminalApp/Pane.cpp index 2bef061af7..9130aec77d 100644 --- a/src/cascadia/TerminalApp/Pane.cpp +++ b/src/cascadia/TerminalApp/Pane.cpp @@ -1032,7 +1032,7 @@ winrt::fire_and_forget Pane::_playBellSound(winrt::Windows::Foundation::Uri uri) { auto weakThis{ weak_from_this() }; - co_await winrt::resume_foreground(_root.Dispatcher()); + co_await wil::resume_foreground(_root.Dispatcher()); if (auto pane{ weakThis.lock() }) { // BODGY @@ -1761,7 +1761,7 @@ winrt::fire_and_forget Pane::_CloseChildRoutine(const bool closeFirst) { auto weakThis{ shared_from_this() }; - co_await winrt::resume_foreground(_root.Dispatcher()); + co_await wil::resume_foreground(_root.Dispatcher()); if (auto pane{ weakThis.get() }) { diff --git a/src/cascadia/TerminalApp/SettingsTab.cpp b/src/cascadia/TerminalApp/SettingsTab.cpp index 4eb0457d1b..54e48ed1e0 100644 --- a/src/cascadia/TerminalApp/SettingsTab.cpp +++ b/src/cascadia/TerminalApp/SettingsTab.cpp @@ -94,7 +94,7 @@ namespace winrt::TerminalApp::implementation { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { diff --git a/src/cascadia/TerminalApp/TabBase.cpp b/src/cascadia/TerminalApp/TabBase.cpp index 6667f760ea..167b500806 100644 --- a/src/cascadia/TerminalApp/TabBase.cpp +++ b/src/cascadia/TerminalApp/TabBase.cpp @@ -183,7 +183,7 @@ namespace winrt::TerminalApp::implementation auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { diff --git a/src/cascadia/TerminalApp/TabManagement.cpp b/src/cascadia/TerminalApp/TabManagement.cpp index 2989e847a3..bf3fc39221 100644 --- a/src/cascadia/TerminalApp/TabManagement.cpp +++ b/src/cascadia/TerminalApp/TabManagement.cpp @@ -716,7 +716,7 @@ namespace winrt::TerminalApp::implementation // sometimes set focus to an incorrect tab after removing some tabs auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(_tabView.Dispatcher()); + co_await wil::resume_foreground(_tabView.Dispatcher()); if (auto page{ weakThis.get() }) { diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 8f79e9b809..9169465308 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -591,7 +591,7 @@ namespace winrt::TerminalApp::implementation auto weakThis{ get_weak() }; // Handle it on a subsequent pass of the UI thread. - co_await winrt::resume_foreground(Dispatcher(), CoreDispatcherPriority::Normal); + co_await wil::resume_foreground(Dispatcher(), CoreDispatcherPriority::Normal); // If the caller provided a CWD, switch to that directory, then switch // back once we're done. This looks weird though, because we have to set @@ -1040,7 +1040,7 @@ namespace winrt::TerminalApp::implementation winrt::fire_and_forget TerminalPage::_RemoveOnCloseRoutine(Microsoft::UI::Xaml::Controls::TabViewItem tabViewItem, winrt::com_ptr page) { - co_await winrt::resume_foreground(page->_tabView.Dispatcher()); + co_await wil::resume_foreground(page->_tabView.Dispatcher()); if (auto tab{ _GetTabByTabViewItem(tabViewItem) }) { @@ -2040,7 +2040,7 @@ namespace winrt::TerminalApp::implementation winrt::fire_and_forget TerminalPage::_CopyToClipboardHandler(const IInspectable /*sender*/, const CopyToClipboardEventArgs copiedData) { - co_await winrt::resume_foreground(Dispatcher(), CoreDispatcherPriority::High); + co_await wil::resume_foreground(Dispatcher(), CoreDispatcherPriority::High); DataPackage dataPack = DataPackage(); dataPack.RequestedOperation(DataPackageOperation::Copy); @@ -2154,7 +2154,7 @@ namespace winrt::TerminalApp::implementation if (warnMultiLine || warnLargeText) { - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); // We have to initialize the dialog here to be able to change the text of the text block within it FindName(L"MultiLinePasteDialog").try_as(); @@ -2267,7 +2267,7 @@ namespace winrt::TerminalApp::implementation const Microsoft::Terminal::Control::NoticeEventArgs eventArgs) { auto weakThis = get_weak(); - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto page = weakThis.get()) { winrt::hstring message = eventArgs.Message(); @@ -2334,7 +2334,7 @@ namespace winrt::TerminalApp::implementation // - eventArgs: the arguments specifying how to set the progress indicator winrt::fire_and_forget TerminalPage::_SetTaskbarProgressHandler(const IInspectable /*sender*/, const IInspectable /*eventArgs*/) { - co_await resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); _SetTaskbarProgressHandlers(*this, nullptr); } @@ -3415,7 +3415,7 @@ namespace winrt::TerminalApp::implementation winrt::fire_and_forget TerminalPage::IdentifyWindow() { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto page{ weakThis.get() }) { // If we haven't ever loaded the TeachingTip, then do so now and @@ -3458,7 +3458,7 @@ namespace winrt::TerminalApp::implementation auto weakThis{ get_weak() }; // On the foreground thread, raise property changed notifications, and // display the success toast. - co_await resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto page{ weakThis.get() }) { if (changed) @@ -3550,7 +3550,7 @@ namespace winrt::TerminalApp::implementation winrt::fire_and_forget TerminalPage::RenameFailed() { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto page{ weakThis.get() }) { // If we haven't ever loaded the TeachingTip, then do so now and @@ -3757,7 +3757,7 @@ namespace winrt::TerminalApp::implementation const auto newConnectionState = coreState.ConnectionState(); if (newConnectionState == ConnectionState::Failed && !_IsMessageDismissed(InfoBarMessage::CloseOnExitInfo)) { - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (const auto infoBar = FindName(L"CloseOnExitInfoBar").try_as()) { infoBar.IsOpen(true); diff --git a/src/cascadia/TerminalApp/TerminalTab.cpp b/src/cascadia/TerminalApp/TerminalTab.cpp index 5dc5259617..96ecad9d8b 100644 --- a/src/cascadia/TerminalApp/TerminalTab.cpp +++ b/src/cascadia/TerminalApp/TerminalTab.cpp @@ -146,7 +146,7 @@ namespace winrt::TerminalApp::implementation { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { @@ -288,7 +288,7 @@ namespace winrt::TerminalApp::implementation auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { @@ -307,7 +307,7 @@ namespace winrt::TerminalApp::implementation { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { @@ -336,7 +336,7 @@ namespace winrt::TerminalApp::implementation { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { @@ -351,7 +351,7 @@ namespace winrt::TerminalApp::implementation { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { @@ -398,7 +398,7 @@ namespace winrt::TerminalApp::implementation winrt::fire_and_forget TerminalTab::UpdateTitle() { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(TabViewItem().Dispatcher()); + co_await wil::resume_foreground(TabViewItem().Dispatcher()); if (auto tab{ weakThis.get() }) { const auto activeTitle = _GetActiveTitle(); @@ -424,7 +424,7 @@ namespace winrt::TerminalApp::implementation { auto control = GetActiveTerminalControl(); - co_await winrt::resume_foreground(control.Dispatcher()); + co_await wil::resume_foreground(control.Dispatcher()); const auto currentOffset = control.ScrollOffset(); control.ScrollViewport(::base::ClampAdd(currentOffset, delta)); @@ -865,7 +865,7 @@ namespace winrt::TerminalApp::implementation }); events.taskbarToken = control.SetTaskbarProgress([dispatcher, weakThis](auto&&, auto &&) -> winrt::fire_and_forget { - co_await winrt::resume_foreground(dispatcher); + co_await wil::resume_foreground(dispatcher); // Check if Tab's lifetime has expired if (auto tab{ weakThis.get() }) { @@ -1074,7 +1074,7 @@ namespace winrt::TerminalApp::implementation { if (tab->_zoomedPane) { - co_await winrt::resume_foreground(tab->Content().Dispatcher()); + co_await wil::resume_foreground(tab->Content().Dispatcher()); tab->Content(tab->_rootPane->GetRootElement()); tab->ExitZoom(); @@ -1088,7 +1088,7 @@ namespace winrt::TerminalApp::implementation // did not actually change. Triggering if (pane != tab->_activePane && !tab->_activePane->_IsLeaf()) { - co_await winrt::resume_foreground(tab->Content().Dispatcher()); + co_await wil::resume_foreground(tab->Content().Dispatcher()); tab->_UpdateActivePane(tab->_activePane); } diff --git a/src/cascadia/TerminalApp/pch.h b/src/cascadia/TerminalApp/pch.h index 92e8003e4e..0ba3fd6fbf 100644 --- a/src/cascadia/TerminalApp/pch.h +++ b/src/cascadia/TerminalApp/pch.h @@ -82,3 +82,4 @@ TRACELOGGING_DECLARE_PROVIDER(g_hTerminalAppProvider); #include "til.h" #include +#include // must go after the CoreDispatcher type is defined diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 2410f585b7..d09c1c0688 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -244,7 +244,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation // Dispatch a call to the UI thread to apply the new settings to the // terminal. - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); _core.UpdateSettings(settings, unfocusedAppearance); @@ -260,7 +260,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation winrt::fire_and_forget TermControl::UpdateAppearance(IControlAppearance newAppearance) { // Dispatch a call to the UI thread - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); _UpdateAppearanceFromUIThread(newAppearance); } @@ -504,7 +504,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation const IInspectable& /*args*/) { auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto control{ weakThis.get() }) { til::color newBgColor{ _core.BackgroundColor() }; @@ -626,7 +626,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation // We also don't lock for things that come back from the renderer. auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto control{ weakThis.get() }) { @@ -651,7 +651,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation const auto hr = static_cast(args.Result()); auto weakThis{ get_weak() }; - co_await winrt::resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto control{ weakThis.get() }) { @@ -1376,7 +1376,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation winrt::fire_and_forget TermControl::_coreTransparencyChanged(IInspectable /*sender*/, Control::TransparencyChangedEventArgs /*args*/) { - co_await resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); try { _changeBackgroundOpacity(); @@ -1771,7 +1771,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation // just go ahead and do it. // This can come in off the COM thread - hop back to the UI thread. auto weakThis{ get_weak() }; - co_await resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto control{ weakThis.get() }; !control->_IsClosing()) { control->TSFInputControl().TryRedrawCanvas(); @@ -2618,7 +2618,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation IInspectable args) { auto weakThis{ get_weak() }; - co_await resume_foreground(Dispatcher()); + co_await wil::resume_foreground(Dispatcher()); if (auto self{ weakThis.get() }) { auto lastHoveredCell = _core.HoveredCell(); diff --git a/src/cascadia/TerminalControl/pch.h b/src/cascadia/TerminalControl/pch.h index 018137572f..7d710c5b5c 100644 --- a/src/cascadia/TerminalControl/pch.h +++ b/src/cascadia/TerminalControl/pch.h @@ -65,3 +65,4 @@ TRACELOGGING_DECLARE_PROVIDER(g_hTerminalControlProvider); #include "ThrottledFunc.h" #include +#include // must go after the CoreDispatcher type is defined diff --git a/src/cascadia/TerminalSettingsModel/pch.h b/src/cascadia/TerminalSettingsModel/pch.h index b922b9efea..3f0220ef1a 100644 --- a/src/cascadia/TerminalSettingsModel/pch.h +++ b/src/cascadia/TerminalSettingsModel/pch.h @@ -58,3 +58,4 @@ TRACELOGGING_DECLARE_PROVIDER(g_hSettingsModelProvider); #include #include +#include // must go after the CoreDispatcher type is defined diff --git a/src/cascadia/WindowsTerminal/AppHost.cpp b/src/cascadia/WindowsTerminal/AppHost.cpp index 3ebfd52593..a12f1f1ca6 100644 --- a/src/cascadia/WindowsTerminal/AppHost.cpp +++ b/src/cascadia/WindowsTerminal/AppHost.cpp @@ -841,7 +841,7 @@ winrt::Windows::Foundation::IAsyncOperation AppHost::_GetWindowL winrt::hstring layoutJson = L""; // Use the main thread since we are accessing controls. - co_await winrt::resume_foreground(_logic.GetRoot().Dispatcher()); + co_await wil::resume_foreground(_logic.GetRoot().Dispatcher()); try { const auto pos = _GetWindowLaunchPosition(); @@ -1017,7 +1017,7 @@ void AppHost::_listenForInboundConnections() winrt::fire_and_forget AppHost::_setupGlobalHotkeys() { // The hotkey MUST be registered on the main thread. It will fail otherwise! - co_await winrt::resume_foreground(_logic.GetRoot().Dispatcher()); + co_await wil::resume_foreground(_logic.GetRoot().Dispatcher()); if (!_window) { @@ -1354,7 +1354,7 @@ winrt::fire_and_forget AppHost::_QuitRequested(const winrt::Windows::Foundation: const winrt::Windows::Foundation::IInspectable&) { // Need to be on the main thread to close out all of the tabs. - co_await winrt::resume_foreground(_logic.GetRoot().Dispatcher()); + co_await wil::resume_foreground(_logic.GetRoot().Dispatcher()); _logic.Quit(); } diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp index bacf5c35b5..b336c60a7f 100644 --- a/src/cascadia/WindowsTerminal/IslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp @@ -1207,7 +1207,7 @@ bool IslandWindow::RegisterHotKey(const int index, const winrt::Microsoft::Termi winrt::fire_and_forget IslandWindow::SummonWindow(Remoting::SummonWindowBehavior args) { // On the foreground thread: - co_await winrt::resume_foreground(_rootGrid.Dispatcher()); + co_await wil::resume_foreground(_rootGrid.Dispatcher()); _summonWindowRoutineBody(args); } diff --git a/src/cascadia/WindowsTerminal/pch.h b/src/cascadia/WindowsTerminal/pch.h index 66664b2a07..19bfcdb27f 100644 --- a/src/cascadia/WindowsTerminal/pch.h +++ b/src/cascadia/WindowsTerminal/pch.h @@ -91,3 +91,4 @@ TRACELOGGING_DECLARE_PROVIDER(g_hWindowsTerminalProvider); #include "til.h" #include +#include // must go after the CoreDispatcher type is defined diff --git a/src/cascadia/wt/wt.vcxproj b/src/cascadia/wt/wt.vcxproj index e1e47c1709..ab3bc16ae5 100644 --- a/src/cascadia/wt/wt.vcxproj +++ b/src/cascadia/wt/wt.vcxproj @@ -11,6 +11,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/src/common.build.pre.props b/src/common.build.pre.props index b817850822..80ed4fd94e 100644 --- a/src/common.build.pre.props +++ b/src/common.build.pre.props @@ -112,7 +112,7 @@ true precomp.h ProgramDatabase - $(SolutionDir)\src\inc;$(SolutionDir)\dep;$(SolutionDir)\dep\Console;$(SolutionDir)\dep\gsl\include;$(SolutionDir)\dep\wil\include;$(SolutionDir)\dep\Win32K;$(SolutionDir)\oss\boost\boost_1_73_0;$(SolutionDir)\oss\chromium;$(SolutionDir)\oss\dynamic_bitset;$(SolutionDir)\oss\fmt\include;$(SolutionDir)\oss\interval_tree;$(SolutionDir)\oss\libpopcnt;$(SolutionDir)\oss\pcg\include;%(AdditionalIncludeDirectories); + $(SolutionDir)\src\inc;$(SolutionDir)\dep;$(SolutionDir)\dep\Console;$(SolutionDir)\dep\gsl\include;$(SolutionDir)\dep\Win32K;$(SolutionDir)\oss\boost\boost_1_73_0;$(SolutionDir)\oss\chromium;$(SolutionDir)\oss\dynamic_bitset;$(SolutionDir)\oss\fmt\include;$(SolutionDir)\oss\interval_tree;$(SolutionDir)\oss\libpopcnt;$(SolutionDir)\oss\pcg\include;%(AdditionalIncludeDirectories); true false false @@ -227,7 +227,7 @@ This project references git submodule(s) that are missing on this computer. Use `git submodule update --init --recursive` to download them. For more information, see https://github.com/microsoft/terminal#building-the-code. - + diff --git a/src/common.nugetversions.targets b/src/common.nugetversions.targets index 025d741894..7062126260 100644 --- a/src/common.nugetversions.targets +++ b/src/common.nugetversions.targets @@ -58,6 +58,9 @@ + + + @@ -92,6 +95,9 @@ + + + diff --git a/src/host/exe/Host.EXE.vcxproj b/src/host/exe/Host.EXE.vcxproj index c21bb27c8a..40d3007b2b 100644 --- a/src/host/exe/Host.EXE.vcxproj +++ b/src/host/exe/Host.EXE.vcxproj @@ -11,6 +11,7 @@ + @@ -96,4 +97,5 @@ + diff --git a/src/host/lib/hostlib.vcxproj b/src/host/lib/hostlib.vcxproj index fb83977af9..cf35a1301e 100644 --- a/src/host/lib/hostlib.vcxproj +++ b/src/host/lib/hostlib.vcxproj @@ -9,8 +9,10 @@ StaticLibrary + + diff --git a/src/interactivity/base/lib/InteractivityBase.vcxproj b/src/interactivity/base/lib/InteractivityBase.vcxproj index 0161b56daa..0af5193c7e 100644 --- a/src/interactivity/base/lib/InteractivityBase.vcxproj +++ b/src/interactivity/base/lib/InteractivityBase.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -50,4 +51,5 @@ + diff --git a/src/interactivity/win32/lib/win32.LIB.vcxproj b/src/interactivity/win32/lib/win32.LIB.vcxproj index 82a57c1239..6ce9bc9eba 100644 --- a/src/interactivity/win32/lib/win32.LIB.vcxproj +++ b/src/interactivity/win32/lib/win32.LIB.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + _WINDLL;%(PreprocessorDefinitions) @@ -73,4 +74,5 @@ + diff --git a/src/internal/internal.vcxproj b/src/internal/internal.vcxproj index 332586eb19..f9be0aa8aa 100644 --- a/src/internal/internal.vcxproj +++ b/src/internal/internal.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -21,4 +22,5 @@ + diff --git a/src/propsheet/propsheet.vcxproj b/src/propsheet/propsheet.vcxproj index 01f16cf1b2..55b315a0fc 100644 --- a/src/propsheet/propsheet.vcxproj +++ b/src/propsheet/propsheet.vcxproj @@ -9,6 +9,7 @@ DynamicLibrary + @@ -85,4 +86,5 @@ + diff --git a/src/propslib/propslib.vcxproj b/src/propslib/propslib.vcxproj index bf1fa6d63e..20b38f341f 100644 --- a/src/propslib/propslib.vcxproj +++ b/src/propslib/propslib.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -28,4 +29,5 @@ + diff --git a/src/renderer/atlas/atlas.vcxproj b/src/renderer/atlas/atlas.vcxproj index 5b257695e0..662865002d 100644 --- a/src/renderer/atlas/atlas.vcxproj +++ b/src/renderer/atlas/atlas.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -51,10 +52,11 @@ + pch.h $(OutDir)$(ProjectName)\;%(AdditionalIncludeDirectories) - \ No newline at end of file + diff --git a/src/renderer/base/lib/base.vcxproj b/src/renderer/base/lib/base.vcxproj index ceed166fd2..99ec05c940 100644 --- a/src/renderer/base/lib/base.vcxproj +++ b/src/renderer/base/lib/base.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -40,4 +41,5 @@ + diff --git a/src/renderer/dx/lib/dx.vcxproj b/src/renderer/dx/lib/dx.vcxproj index d26c951f43..d54407c5b8 100644 --- a/src/renderer/dx/lib/dx.vcxproj +++ b/src/renderer/dx/lib/dx.vcxproj @@ -14,6 +14,7 @@ + @@ -41,4 +42,5 @@ + diff --git a/src/renderer/gdi/lib/gdi.vcxproj b/src/renderer/gdi/lib/gdi.vcxproj index bf1fe0758f..95922dc322 100644 --- a/src/renderer/gdi/lib/gdi.vcxproj +++ b/src/renderer/gdi/lib/gdi.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -29,4 +30,5 @@ + diff --git a/src/renderer/uia/lib/uia.vcxproj b/src/renderer/uia/lib/uia.vcxproj index d67ddc1406..70b4c245b4 100644 --- a/src/renderer/uia/lib/uia.vcxproj +++ b/src/renderer/uia/lib/uia.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + Create @@ -21,4 +22,5 @@ + diff --git a/src/renderer/vt/lib/vt.vcxproj b/src/renderer/vt/lib/vt.vcxproj index eac03be76a..ff5095a3a3 100644 --- a/src/renderer/vt/lib/vt.vcxproj +++ b/src/renderer/vt/lib/vt.vcxproj @@ -9,8 +9,10 @@ StaticLibrary + + diff --git a/src/server/lib/server.vcxproj b/src/server/lib/server.vcxproj index d7f05cf139..cadd74b0b8 100644 --- a/src/server/lib/server.vcxproj +++ b/src/server/lib/server.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -69,4 +70,5 @@ + diff --git a/src/terminal/adapter/lib/adapter.vcxproj b/src/terminal/adapter/lib/adapter.vcxproj index 6ec11be72a..0a6b120579 100644 --- a/src/terminal/adapter/lib/adapter.vcxproj +++ b/src/terminal/adapter/lib/adapter.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -46,4 +47,5 @@ - \ No newline at end of file + + diff --git a/src/terminal/input/lib/terminalinput.vcxproj b/src/terminal/input/lib/terminalinput.vcxproj index 0dd6aead6f..16f495dcd2 100644 --- a/src/terminal/input/lib/terminalinput.vcxproj +++ b/src/terminal/input/lib/terminalinput.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -28,4 +29,5 @@ - \ No newline at end of file + + diff --git a/src/terminal/parser/lib/parser.vcxproj b/src/terminal/parser/lib/parser.vcxproj index 35cd5abdd2..31a950e33d 100644 --- a/src/terminal/parser/lib/parser.vcxproj +++ b/src/terminal/parser/lib/parser.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -19,4 +20,5 @@ + diff --git a/src/tools/buffersize/buffersize.vcxproj b/src/tools/buffersize/buffersize.vcxproj index c599bdf8e3..998c2ee745 100644 --- a/src/tools/buffersize/buffersize.vcxproj +++ b/src/tools/buffersize/buffersize.vcxproj @@ -9,6 +9,7 @@ Application + @@ -24,4 +25,5 @@ + diff --git a/src/tools/echokey/ConEchoKey.vcxproj b/src/tools/echokey/ConEchoKey.vcxproj index 9d91d6ccbb..7a9fe839d6 100644 --- a/src/tools/echokey/ConEchoKey.vcxproj +++ b/src/tools/echokey/ConEchoKey.vcxproj @@ -9,6 +9,7 @@ Application + @@ -24,4 +25,5 @@ + diff --git a/src/tools/fontlist/FontList.vcxproj b/src/tools/fontlist/FontList.vcxproj index e3974b647e..040497286d 100644 --- a/src/tools/fontlist/FontList.vcxproj +++ b/src/tools/fontlist/FontList.vcxproj @@ -9,6 +9,7 @@ Application + @@ -24,4 +25,5 @@ + diff --git a/src/tools/vtpipeterm/VtPipeTerm.vcxproj b/src/tools/vtpipeterm/VtPipeTerm.vcxproj index a292ee1e0a..9b2fcb372b 100644 --- a/src/tools/vtpipeterm/VtPipeTerm.vcxproj +++ b/src/tools/vtpipeterm/VtPipeTerm.vcxproj @@ -9,6 +9,7 @@ Application + @@ -28,4 +29,5 @@ + diff --git a/src/tsf/tsf.vcxproj b/src/tsf/tsf.vcxproj index ac41260c6d..1e5a3f0cdf 100644 --- a/src/tsf/tsf.vcxproj +++ b/src/tsf/tsf.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -34,4 +35,5 @@ + diff --git a/src/types/lib/types.vcxproj b/src/types/lib/types.vcxproj index bebe7059a3..24372906d7 100644 --- a/src/types/lib/types.vcxproj +++ b/src/types/lib/types.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -70,4 +71,5 @@ + diff --git a/src/winconpty/dll/winconptydll.vcxproj b/src/winconpty/dll/winconptydll.vcxproj index 8c9d17ee6d..a9467f61ab 100644 --- a/src/winconpty/dll/winconptydll.vcxproj +++ b/src/winconpty/dll/winconptydll.vcxproj @@ -9,6 +9,7 @@ DynamicLibrary + Create @@ -22,6 +23,7 @@ + winconpty.def diff --git a/src/winconpty/lib/winconptylib.vcxproj b/src/winconpty/lib/winconptylib.vcxproj index ea4b63f835..ce30460c59 100644 --- a/src/winconpty/lib/winconptylib.vcxproj +++ b/src/winconpty/lib/winconptylib.vcxproj @@ -9,6 +9,7 @@ StaticLibrary + @@ -24,7 +25,8 @@ -