diff --git a/.github/actions/spelling/allow/apis.txt b/.github/actions/spelling/allow/apis.txt index f7671d04f4..9be081bc2b 100644 --- a/.github/actions/spelling/allow/apis.txt +++ b/.github/actions/spelling/allow/apis.txt @@ -222,6 +222,7 @@ Stubless Subheader Subpage syscall +syscolors SYSTEMBACKDROP TABROW TASKBARCREATED diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index 4356e36eae..f80ab40840 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -1679,6 +1679,7 @@ SMARTQUOTE SMTO snapcx snapcy +snk SOLIDBOX Solutiondir somefile diff --git a/build/config/272MSSharedLibSN2048.snk b/build/config/272MSSharedLibSN2048.snk new file mode 100644 index 0000000000..bd766f84a2 Binary files /dev/null and b/build/config/272MSSharedLibSN2048.snk differ diff --git a/build/config/esrp.build.batch.wpfdotnet.json b/build/config/esrp.build.batch.wpfdotnet.json index 0699353f64..316aa70116 100644 --- a/build/config/esrp.build.batch.wpfdotnet.json +++ b/build/config/esrp.build.batch.wpfdotnet.json @@ -6,6 +6,20 @@ ], "SigningInfo": { "Operations": [ + { + "KeyCode": "CP-233904-SN", + "OperationSetCode": "StrongNameSign", + "ToolName": "sign", + "ToolVersion": "1.0", + "Parameters": [] + }, + { + "KeyCode": "CP-233904-SN", + "OperationSetCode": "StrongNameVerify", + "ToolName": "sign", + "ToolVersion": "1.0", + "Parameters": [] + }, { "KeyCode": "CP-230012", "OperationSetCode": "SigntoolSign", diff --git a/src/audio/midi/lib/sources.dep b/src/audio/midi/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/audio/midi/lib/sources.dep +++ b/src/audio/midi/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/buffer/out/ImageSlice.cpp b/src/buffer/out/ImageSlice.cpp index 65809e58a0..3500eaf0a5 100644 --- a/src/buffer/out/ImageSlice.cpp +++ b/src/buffer/out/ImageSlice.cpp @@ -186,18 +186,20 @@ bool ImageSlice::_copyCells(const ImageSlice& srcSlice, const til::CoordType src } // The used destination before and after the written area must be erased. - if (dstUsedBegin < dstWriteBegin) + // If this results in the entire range being erased, we return true to let + // the caller know that the slice should be deleted. + if (dstUsedBegin < dstWriteBegin && _eraseCells(dstUsedBegin, dstWriteBegin)) { - _eraseCells(dstUsedBegin, dstWriteBegin); + return true; } - if (dstUsedEnd > dstWriteEnd) + if (dstUsedEnd > dstWriteEnd && _eraseCells(dstWriteEnd, dstUsedEnd)) { - _eraseCells(dstWriteEnd, dstUsedEnd); + return true; } - // If the beginning column is now not less than the end, that means the - // content has been entirely erased, so we return true to let the caller - // know that the slice should be deleted. + // At this point, if the beginning column is not less than the end, that + // means this was an empty slice into which nothing was copied, so we can + // again return true to let the caller know it should be deleted. return _columnBegin >= _columnEnd; } @@ -210,10 +212,19 @@ void ImageSlice::EraseBlock(TextBuffer& buffer, const til::rect rect) } } -void ImageSlice::EraseCells(TextBuffer& buffer, const til::point at, const size_t distance) +void ImageSlice::EraseCells(TextBuffer& buffer, const til::point at, const til::CoordType distance) { - auto& row = buffer.GetMutableRowByOffset(at.y); - EraseCells(row, at.x, gsl::narrow_cast(at.x + distance)); + auto x = at.x; + auto y = at.y; + auto distanceRemaining = distance; + while (distanceRemaining > 0) + { + auto& row = buffer.GetMutableRowByOffset(y); + EraseCells(row, x, x + distanceRemaining); + distanceRemaining -= (static_cast(row.size()) - x); + x = 0; + y++; + } } void ImageSlice::EraseCells(ROW& row, const til::CoordType columnBegin, const til::CoordType columnEnd) diff --git a/src/buffer/out/ImageSlice.hpp b/src/buffer/out/ImageSlice.hpp index 87244abe78..14c0b314ae 100644 --- a/src/buffer/out/ImageSlice.hpp +++ b/src/buffer/out/ImageSlice.hpp @@ -41,7 +41,7 @@ public: static void CopyRow(const ROW& srcRow, ROW& dstRow); static void CopyCells(const ROW& srcRow, const til::CoordType srcColumn, ROW& dstRow, const til::CoordType dstColumnBegin, const til::CoordType dstColumnEnd); static void EraseBlock(TextBuffer& buffer, const til::rect rect); - static void EraseCells(TextBuffer& buffer, const til::point at, const size_t distance); + static void EraseCells(TextBuffer& buffer, const til::point at, const til::CoordType distance); static void EraseCells(ROW& row, const til::CoordType columnBegin, const til::CoordType columnEnd); private: diff --git a/src/buffer/out/lib/sources.dep b/src/buffer/out/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/buffer/out/lib/sources.dep +++ b/src/buffer/out/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/buffer/out/ut_textbuffer/sources.dep b/src/buffer/out/ut_textbuffer/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/buffer/out/ut_textbuffer/sources.dep +++ b/src/buffer/out/ut_textbuffer/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/cascadia/TerminalControl/HwndTerminal.cpp b/src/cascadia/TerminalControl/HwndTerminal.cpp index d2aa1e1796..3cb02ee547 100644 --- a/src/cascadia/TerminalControl/HwndTerminal.cpp +++ b/src/cascadia/TerminalControl/HwndTerminal.cpp @@ -19,6 +19,79 @@ using namespace ::Microsoft::Terminal::Core; static LPCWSTR term_window_class = L"HwndTerminalClass"; +STDMETHODIMP HwndTerminal::TsfDataProvider::QueryInterface(REFIID, void**) noexcept +{ + return E_NOTIMPL; +} + +ULONG STDMETHODCALLTYPE HwndTerminal::TsfDataProvider::AddRef() noexcept +{ + return 1; +} + +ULONG STDMETHODCALLTYPE HwndTerminal::TsfDataProvider::Release() noexcept +{ + return 1; +} + +HWND HwndTerminal::TsfDataProvider::GetHwnd() +{ + return _terminal->GetHwnd(); +} + +RECT HwndTerminal::TsfDataProvider::GetViewport() +{ + const auto hwnd = GetHwnd(); + + RECT rc; + GetClientRect(hwnd, &rc); + + // https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getclientrect + // > The left and top members are zero. The right and bottom members contain the width and height of the window. + // --> We can turn the client rect into a screen-relative rect by adding the left/top position. + ClientToScreen(hwnd, reinterpret_cast(&rc)); + rc.right += rc.left; + rc.bottom += rc.top; + + return rc; +} + +RECT HwndTerminal::TsfDataProvider::GetCursorPosition() +{ + // Convert from columns/rows to pixels. + til::point cursorPos; + til::size fontSize; + { + const auto lock = _terminal->_terminal->LockForReading(); + cursorPos = _terminal->_terminal->GetCursorPosition(); // measured in terminal cells + fontSize = _terminal->_actualFont.GetSize(); // measured in pixels, not DIP + } + POINT ptSuggestion = { + .x = cursorPos.x * fontSize.width, + .y = cursorPos.y * fontSize.height, + }; + + ClientToScreen(GetHwnd(), &ptSuggestion); + + // Final measurement should be in pixels + return { + .left = ptSuggestion.x, + .top = ptSuggestion.y, + .right = ptSuggestion.x + fontSize.width, + .bottom = ptSuggestion.y + fontSize.height, + }; +} + +void HwndTerminal::TsfDataProvider::HandleOutput(std::wstring_view text) +{ + _terminal->_WriteTextToConnection(text); +} + +Microsoft::Console::Render::Renderer* HwndTerminal::TsfDataProvider::GetRenderer() +{ + return _terminal->_renderer.get(); +} + // This magic flag is "documented" at https://msdn.microsoft.com/en-us/library/windows/desktop/ms646301(v=vs.85).aspx // "If the high-order bit is 1, the key is down; otherwise, it is up." static constexpr short KeyPressed{ gsl::narrow_cast(0x8000) }; @@ -242,6 +315,7 @@ try { // As a rule, detach resources from the Terminal before shutting them down. // This ensures that teardown is reentrant. + _tsfHandle = {}; // Shut down the renderer (and therefore the thread) before we implode _renderer.reset(); @@ -941,6 +1015,16 @@ void __stdcall TerminalSetFocus(void* terminal) { LOG_IF_FAILED(uiaEngine->Enable()); } + publicTerminal->_FocusTSF(); +} + +void HwndTerminal::_FocusTSF() noexcept +{ + if (!_tsfHandle) + { + _tsfHandle = Microsoft::Console::TSF::Handle::Create(); + _tsfHandle.AssociateFocus(&_tsfDataProvider); + } } void __stdcall TerminalKillFocus(void* terminal) diff --git a/src/cascadia/TerminalControl/HwndTerminal.hpp b/src/cascadia/TerminalControl/HwndTerminal.hpp index 8ecd32df02..350727f12a 100644 --- a/src/cascadia/TerminalControl/HwndTerminal.hpp +++ b/src/cascadia/TerminalControl/HwndTerminal.hpp @@ -6,6 +6,7 @@ #include "../../buffer/out/textBuffer.hpp" #include "../../renderer/inc/FontInfoDesired.hpp" #include "../../types/IControlAccessibilityInfo.h" +#include "../../tsf/Handle.h" namespace Microsoft::Console::Render::Atlas { @@ -85,6 +86,21 @@ public: static LRESULT CALLBACK HwndTerminalWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) noexcept; private: + struct TsfDataProvider : public Microsoft::Console::TSF::IDataProvider + { + TsfDataProvider(HwndTerminal* t) : + _terminal(t) {} + virtual ~TsfDataProvider() = default; + STDMETHODIMP TsfDataProvider::QueryInterface(REFIID, void**) noexcept override; + ULONG STDMETHODCALLTYPE TsfDataProvider::AddRef() noexcept override; + ULONG STDMETHODCALLTYPE TsfDataProvider::Release() noexcept override; + HWND GetHwnd() override; + RECT GetViewport() override; + RECT GetCursorPosition() override; + void HandleOutput(std::wstring_view text) override; + Microsoft::Console::Render::Renderer* GetRenderer() override; + HwndTerminal* _terminal; + }; wil::unique_hwnd _hwnd; FontInfoDesired _desiredFont; FontInfo _actualFont; @@ -106,6 +122,10 @@ private: std::optional _lastMouseClickPos; std::optional _singleClickTouchdownPos; + // _tsfHandle uses _tsfDataProvider. Destructors run from bottom to top; this maintains correct destruction order. + TsfDataProvider _tsfDataProvider{ this }; + Microsoft::Console::TSF::Handle _tsfHandle; + friend HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal); friend HRESULT _stdcall TerminalTriggerResize(_In_ void* terminal, _In_ til::CoordType width, _In_ til::CoordType height, _Out_ til::size* dimensions); friend HRESULT _stdcall TerminalTriggerResizeWithDimension(_In_ void* terminal, _In_ til::size dimensions, _Out_ til::size* dimensionsInPixels); @@ -129,6 +149,8 @@ private: HRESULT _CopyToSystemClipboard(const std::string& stringToCopy, LPCWSTR lpszFormat) const; void _PasteTextFromClipboard() noexcept; + void _FocusTSF() noexcept; + const unsigned int _NumberOfClicks(til::point clickPos, std::chrono::steady_clock::time_point clickTime) noexcept; HRESULT _StartSelection(LPARAM lParam) noexcept; HRESULT _MoveSelection(LPARAM lParam) noexcept; diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 60833fdd92..7118c7a868 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2825,6 +2825,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation const auto fontSize = settings.FontSize(); const auto fontWeight = settings.FontWeight(); const auto fontFace = settings.FontFace(); + const auto cellWidth = CSSLengthPercentage::FromString(settings.CellWidth().c_str()); + const auto cellHeight = CSSLengthPercentage::FromString(settings.CellHeight().c_str()); const auto scrollState = settings.ScrollState(); const auto padding = settings.Padding(); @@ -2836,6 +2838,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation // not, but DX doesn't use that info at all. // The Codepage is additionally not actually used by the DX engine at all. FontInfoDesired desiredFont{ fontFace, 0, fontWeight.Weight, fontSize, CP_UTF8 }; + desiredFont.SetCellSize(cellWidth, cellHeight); FontInfo actualFont{ fontFace, 0, fontWeight.Weight, desiredFont.GetEngineSize(), CP_UTF8, false }; // Create a DX engine and initialize it with our font and DPI. We'll diff --git a/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj b/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj index 6581f1478b..8a299b5c05 100644 --- a/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj +++ b/src/cascadia/WpfTerminalControl/WpfTerminalControl.csproj @@ -15,6 +15,12 @@ 0.1 + + true + true + ..\..\..\build\config\272MSSharedLibSN2048.snk + + true diff --git a/src/host/exe/sources.dep b/src/host/exe/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/host/exe/sources.dep +++ b/src/host/exe/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/host/ft_host/sources.dep b/src/host/ft_host/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/host/ft_host/sources.dep +++ b/src/host/ft_host/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/host/lib/sources.dep b/src/host/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/host/lib/sources.dep +++ b/src/host/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/host/sources.inc b/src/host/sources.inc index e8c540fd80..c080c15ce7 100644 --- a/src/host/sources.inc +++ b/src/host/sources.inc @@ -132,7 +132,7 @@ TARGETLIBS = \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\dxgi.lib \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\d3d11.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\api-ms-win-mm-playsound-l1.lib \ - $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1-1-0.lib \ + $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1.lib \ $(ONECORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-dwmapi-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-create-l1.lib \ @@ -160,12 +160,14 @@ TARGETLIBS = \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-sysparams-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-window-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-winstamin-l1.lib \ + $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-syscolors-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-shell-shell32-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uxtheme-themes-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-dataobject-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-namespace-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uiacore-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-usp10-l1.lib \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(WINCORE_OBJ_PATH)\console\open\src\host\lib\$(O)\conhostv2.lib \ $(WINCORE_OBJ_PATH)\console\conint\$(O)\conint.lib \ $(WINCORE_OBJ_PATH)\console\open\src\buffer\out\lib\$(O)\conbufferout.lib \ @@ -177,7 +179,6 @@ TARGETLIBS = \ $(WINCORE_OBJ_PATH)\console\open\src\audio\midi\lib\$(O)\ConAudioMidi.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\base\lib\$(O)\ConRenderBase.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\gdi\lib\$(O)\ConRenderGdi.lib \ - $(WINCORE_OBJ_PATH)\console\open\src\renderer\vt\lib\$(O)\ConRenderVt.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\wddmcon\lib\$(O)\ConRenderWddmCon.lib \ $(WINCORE_OBJ_PATH)\console\open\src\server\lib\$(O)\ConServer.lib \ $(WINCORE_OBJ_PATH)\console\open\src\interactivity\base\lib\$(O)\ConInteractivityBaseLib.lib \ @@ -196,7 +197,7 @@ DELAYLOAD = \ api-ms-win-core-com-l1.dll; \ api-ms-win-core-registry-l2.dll; \ api-ms-win-mm-playsound-l1.dll; \ - ext-ms-win-imm-l1-1-0.lib; \ + ext-ms-win-imm-l1.dll; \ api-ms-win-shcore-obsolete-l1.dll; \ api-ms-win-shcore-scaling-l1.dll; \ api-ms-win-shell-dataobject-l1.dll; \ @@ -229,6 +230,7 @@ DELAYLOAD = \ ext-ms-win-rtcore-ntuser-sysparams-l1.dll; \ ext-ms-win-rtcore-ntuser-window-ext-l1.dll; \ ext-ms-win-rtcore-ntuser-winstamin-l1.dll; \ + ext-ms-win-rtcore-ntuser-syscolors-l1.dll; \ ext-ms-win-shell-shell32-l1.dll; \ ext-ms-win-uiacore-l1.dll; \ ext-ms-win-uxtheme-themes-l1.dll; \ diff --git a/src/host/sources.test.inc b/src/host/sources.test.inc index 7d49665c33..6fd7ff7412 100644 --- a/src/host/sources.test.inc +++ b/src/host/sources.test.inc @@ -24,10 +24,7 @@ INCLUDES = \ ..\..\inc\test; \ $(ONECORESDKTOOLS_INTERNAL_INC_PATH_L)\wextest\cue; \ -# prepend the ConRenderVt.Unittest.lib, so that it's linked before the non-ut version. - TARGETLIBS = \ - $(WINCORE_OBJ_PATH)\console\open\src\renderer\vt\ut_lib\$(O)\ConRenderVt.Unittest.lib \ $(TARGETLIBS) \ $(ONECORESDKTOOLS_INTERNAL_LIB_PATH_L)\WexTest\Cue\Wex.Common.lib \ $(ONECORESDKTOOLS_INTERNAL_LIB_PATH_L)\WexTest\Cue\Wex.Logger.lib \ diff --git a/src/host/ut_host/sources b/src/host/ut_host/sources index b690477830..d8da9ec993 100644 --- a/src/host/ut_host/sources +++ b/src/host/ut_host/sources @@ -41,10 +41,7 @@ INCLUDES = \ ..\..\inc\test; \ $(ONECORESDKTOOLS_INTERNAL_INC_PATH_L)\wextest\cue; \ -# prepend the ConRenderVt.Unittest.lib, so that it's linked before the non-ut version. - TARGETLIBS = \ - $(WINCORE_OBJ_PATH)\console\open\src\renderer\vt\ut_lib\$(O)\ConRenderVt.Unittest.lib \ $(WINCORE_OBJ_PATH)\console\open\src\host\ut_lib\$(O)\ConhostV2.Unittest.lib \ $(TARGETLIBS) \ $(ONECORESDKTOOLS_INTERNAL_LIB_PATH_L)\WexTest\Cue\Wex.Common.lib \ diff --git a/src/host/ut_host/sources.dep b/src/host/ut_host/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/host/ut_host/sources.dep +++ b/src/host/ut_host/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/host/ut_lib/sources.dep b/src/host/ut_lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/host/ut_lib/sources.dep +++ b/src/host/ut_lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/interactivity/base/lib/sources.dep b/src/interactivity/base/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/interactivity/base/lib/sources.dep +++ b/src/interactivity/base/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/interactivity/onecore/lib/sources.dep b/src/interactivity/onecore/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/interactivity/onecore/lib/sources.dep +++ b/src/interactivity/onecore/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/interactivity/win32/lib/sources.dep b/src/interactivity/win32/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/interactivity/win32/lib/sources.dep +++ b/src/interactivity/win32/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/interactivity/win32/sources.inc b/src/interactivity/win32/sources.inc index f816c285db..cd35ffc408 100644 --- a/src/interactivity/win32/sources.inc +++ b/src/interactivity/win32/sources.inc @@ -60,4 +60,5 @@ INCLUDES = \ ..; \ TARGETLIBS = \ + $(TARGETLIBS) \ $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecore.lib \ diff --git a/src/interactivity/win32/ut_interactivity_win32/sources b/src/interactivity/win32/ut_interactivity_win32/sources index 1822bf5179..55eaa847fc 100644 --- a/src/interactivity/win32/ut_interactivity_win32/sources +++ b/src/interactivity/win32/ut_interactivity_win32/sources @@ -50,7 +50,7 @@ TARGETLIBS = \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\dxgi.lib \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\propsys.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\api-ms-win-mm-playsound-l1.lib \ - $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1-1-0.lib \ + $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1.lib \ $(ONECORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-dwmapi-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-create-l1.lib \ @@ -76,12 +76,14 @@ TARGETLIBS = \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-sysparams-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-window-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-winstamin-l1.lib \ + $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-syscolors-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-shell-shell32-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uxtheme-themes-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-dataobject-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-namespace-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uiacore-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-usp10-l1.lib \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(WINCORE_OBJ_PATH)\console\conint\$(O)\conint.lib \ $(WINCORE_OBJ_PATH)\console\open\src\buffer\out\lib\$(O)\conbufferout.lib \ $(WINCORE_OBJ_PATH)\console\open\src\host\lib\$(O)\conhostv2.lib \ @@ -93,7 +95,6 @@ TARGETLIBS = \ $(WINCORE_OBJ_PATH)\console\open\src\audio\midi\lib\$(O)\ConAudioMidi.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\base\lib\$(O)\ConRenderBase.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\gdi\lib\$(O)\ConRenderGdi.lib \ - $(WINCORE_OBJ_PATH)\console\open\src\renderer\vt\lib\$(O)\ConRenderVt.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\wddmcon\lib\$(O)\ConRenderWddmCon.lib \ $(WINCORE_OBJ_PATH)\console\open\src\server\lib\$(O)\ConServer.lib \ $(WINCORE_OBJ_PATH)\console\open\src\interactivity\base\lib\$(O)\ConInteractivityBaseLib.lib \ @@ -112,7 +113,7 @@ DELAYLOAD = \ OLEAUT32.dll; \ icu.dll; \ api-ms-win-mm-playsound-l1.dll; \ - ext-ms-win-imm-l1-1-0.lib; \ + ext-ms-win-imm-l1.dll; \ api-ms-win-shcore-scaling-l1.dll; \ api-ms-win-shell-dataobject-l1.dll; \ api-ms-win-shell-namespace-l1.dll; \ @@ -143,6 +144,7 @@ DELAYLOAD = \ ext-ms-win-rtcore-ntuser-sysparams-l1.dll; \ ext-ms-win-rtcore-ntuser-window-ext-l1.dll; \ ext-ms-win-rtcore-ntuser-winstamin-l1.dll; \ + ext-ms-win-rtcore-ntuser-syscolors-l1.dll; \ ext-ms-win-shell-shell32-l1.dll; \ ext-ms-win-uiacore-l1.dll; \ ext-ms-win-uxtheme-themes-l1.dll; \ diff --git a/src/interactivity/win32/ut_interactivity_win32/sources.dep b/src/interactivity/win32/ut_interactivity_win32/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/interactivity/win32/ut_interactivity_win32/sources.dep +++ b/src/interactivity/win32/ut_interactivity_win32/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/project.inc b/src/project.inc index 1d86343d9c..152aca2717 100644 --- a/src/project.inc +++ b/src/project.inc @@ -4,16 +4,16 @@ # ------------------------------------- # Pull our dependencies from vcpkg. This includes gsl - if you run into errors -# from a missing gsl, make sure you go build onecore/window/vcpkg first. +# from a missing gsl or fmt, make sure you go build .../console/vcpkg first. -!include $(PROJECT_ROOT)\vcpkg\consume.inc +!include $(PROJECT_ROOT)\core\console\vcpkg\consume.inc # ------------------------------------- # Preprocessor Settings # ------------------------------------- UNICODE = 1 -C_DEFINES = $(C_DEFINES) -DUNICODE -D_UNICODE -DFMT_HEADER_ONLY -D__INSIDE_WINDOWS -DBUILD_ONECORE_INTERACTIVITY +C_DEFINES = $(C_DEFINES) -DUNICODE -D_UNICODE -D__INSIDE_WINDOWS -DBUILD_ONECORE_INTERACTIVITY # ------------------------------------- # CRT Configuration @@ -50,7 +50,6 @@ INCLUDES= \ $(CONSOLE_SRC_PATH)\inc; \ $(CONSOLE_SRC_PATH)\..\..\inc; \ $(CONSOLE_SRC_PATH)\..\oss\chromium; \ - $(CONSOLE_SRC_PATH)\..\oss\fmt\include; \ $(CONSOLE_SRC_PATH)\..\oss\interval_tree; \ $(CONSOLE_SRC_PATH)\..\oss\pcg\include; \ $(MINWIN_INTERNAL_PRIV_SDK_INC_PATH_L); \ diff --git a/src/project.unittest.inc b/src/project.unittest.inc index 8d625b78e8..a4f5daf4bb 100644 --- a/src/project.unittest.inc +++ b/src/project.unittest.inc @@ -9,7 +9,7 @@ # Preprocessor Settings # ------------------------------------- -C_DEFINES = $(C_DEFINES) -DINLINE_TEST_METHOD_MARKUP -DUNIT_TESTING -DFMT_HEADER_ONLY +C_DEFINES = $(C_DEFINES) -DINLINE_TEST_METHOD_MARKUP -DUNIT_TESTING # ------------------------------------- # Program Information @@ -32,6 +32,7 @@ INCLUDES = \ TARGETLIBS = \ $(TARGETLIBS) \ $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecore.lib \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(ONECORESDKTOOLS_INTERNAL_LIB_PATH_L)\WexTest\Cue\Wex.Common.lib \ $(ONECORESDKTOOLS_INTERNAL_LIB_PATH_L)\WexTest\Cue\Wex.Logger.lib \ $(ONECORESDKTOOLS_INTERNAL_LIB_PATH_L)\WexTest\Cue\Te.Common.lib \ diff --git a/src/propsheet/sources b/src/propsheet/sources index 033d3a5396..84bf81282e 100644 --- a/src/propsheet/sources +++ b/src/propsheet/sources @@ -78,6 +78,7 @@ INCLUDES = \ ..\host; \ TARGETLIBS = \ + $(TARGETLIBS) \ $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecore.lib \ $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecoreuap.lib \ $(ONECORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\onecore_internal.lib \ diff --git a/src/propsheet/sources.dep b/src/propsheet/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/propsheet/sources.dep +++ b/src/propsheet/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/propslib/sources.dep b/src/propslib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/propslib/sources.dep +++ b/src/propslib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/renderer/base/lib/sources.dep b/src/renderer/base/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/renderer/base/lib/sources.dep +++ b/src/renderer/base/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/renderer/gdi/lib/sources.dep b/src/renderer/gdi/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/renderer/gdi/lib/sources.dep +++ b/src/renderer/gdi/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/renderer/wddmcon/lib/sources.dep b/src/renderer/wddmcon/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/renderer/wddmcon/lib/sources.dep +++ b/src/renderer/wddmcon/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/server/lib/sources.dep b/src/server/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/server/lib/sources.dep +++ b/src/server/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/adapter/lib/sources.dep b/src/terminal/adapter/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/adapter/lib/sources.dep +++ b/src/terminal/adapter/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/adapter/ut_adapter/MouseInputTest.cpp b/src/terminal/adapter/ut_adapter/MouseInputTest.cpp index f3df50a0a6..fe39b86630 100644 --- a/src/terminal/adapter/ut_adapter/MouseInputTest.cpp +++ b/src/terminal/adapter/ut_adapter/MouseInputTest.cpp @@ -99,7 +99,7 @@ public: TerminalInput::StringType str; str.append(std::wstring_view{ buffer }); - str[str.size() - 1] = IsButtonDown(uiButton) ? L'M' : L'm'; + str[str.size() - 1] = IsButtonUp(uiButton) ? L'm' : L'M'; return str; } @@ -182,23 +182,18 @@ public: return result; } - bool IsButtonDown(unsigned int uiButton) + bool IsButtonUp(unsigned int uiButton) { - auto fIsDown = false; switch (uiButton) { - case WM_LBUTTONDBLCLK: - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_RBUTTONDBLCLK: - case WM_MBUTTONDOWN: - case WM_MBUTTONDBLCLK: - case WM_MOUSEWHEEL: - case WM_MOUSEHWHEEL: - fIsDown = true; - break; + case WM_LBUTTONUP: + case WM_RBUTTONUP: + case WM_MBUTTONUP: + case WM_XBUTTONUP: + return true; + default: + return false; } - return fIsDown; } /* From winuser.h - Needed to manually specify the test properties diff --git a/src/terminal/adapter/ut_adapter/sources b/src/terminal/adapter/ut_adapter/sources index 6f4eb322a2..2fe3c59699 100644 --- a/src/terminal/adapter/ut_adapter/sources +++ b/src/terminal/adapter/ut_adapter/sources @@ -48,7 +48,7 @@ TARGETLIBS = \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\d3d11.lib \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\d3dcompiler.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\api-ms-win-mm-playsound-l1.lib \ - $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1-1-0.lib \ + $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1.lib \ $(ONECORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-dwmapi-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-create-l1.lib \ @@ -73,12 +73,14 @@ TARGETLIBS = \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-sysparams-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-window-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-winstamin-l1.lib \ + $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-syscolors-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-shell-shell32-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uxtheme-themes-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-dataobject-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-namespace-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uiacore-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-usp10-l1.lib \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(WINCORE_OBJ_PATH)\console\conint\$(O)\conint.lib \ $(WINCORE_OBJ_PATH)\console\open\src\buffer\out\lib\$(O)\conbufferout.lib \ $(WINCORE_OBJ_PATH)\console\open\src\host\lib\$(O)\conhostv2.lib \ @@ -91,7 +93,6 @@ TARGETLIBS = \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\base\lib\$(O)\ConRenderBase.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\gdi\lib\$(O)\ConRenderGdi.lib \ $(WINCORE_OBJ_PATH)\console\open\src\renderer\wddmcon\lib\$(O)\ConRenderWddmCon.lib \ - $(WINCORE_OBJ_PATH)\console\open\src\renderer\vt\lib\$(O)\ConRenderVt.lib \ $(WINCORE_OBJ_PATH)\console\open\src\server\lib\$(O)\ConServer.lib \ $(WINCORE_OBJ_PATH)\console\open\src\interactivity\base\lib\$(O)\ConInteractivityBaseLib.lib \ $(WINCORE_OBJ_PATH)\console\open\src\interactivity\win32\lib\$(O)\ConInteractivityWin32Lib.lib \ @@ -107,7 +108,7 @@ DELAYLOAD = \ OLEAUT32.dll; \ icu.dll; \ api-ms-win-mm-playsound-l1.dll; \ - ext-ms-win-imm-l1-1-0.lib; \ + ext-ms-win-imm-l1.dll; \ api-ms-win-shcore-scaling-l1.dll; \ api-ms-win-shell-dataobject-l1.dll; \ api-ms-win-shell-namespace-l1.dll; \ @@ -137,6 +138,7 @@ DELAYLOAD = \ ext-ms-win-rtcore-ntuser-sysparams-l1.dll; \ ext-ms-win-rtcore-ntuser-window-ext-l1.dll; \ ext-ms-win-rtcore-ntuser-winstamin-l1.dll; \ + ext-ms-win-rtcore-ntuser-syscolors-l1.dll; \ ext-ms-win-shell-shell32-l1.dll; \ ext-ms-win-uiacore-l1.dll; \ ext-ms-win-uxtheme-themes-l1.dll; \ diff --git a/src/terminal/adapter/ut_adapter/sources.dep b/src/terminal/adapter/ut_adapter/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/adapter/ut_adapter/sources.dep +++ b/src/terminal/adapter/ut_adapter/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/input/lib/sources.dep b/src/terminal/input/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/input/lib/sources.dep +++ b/src/terminal/input/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/input/mouseInput.cpp b/src/terminal/input/mouseInput.cpp index 596df0360e..c36ce160b4 100644 --- a/src/terminal/input/mouseInput.cpp +++ b/src/terminal/input/mouseInput.cpp @@ -63,24 +63,19 @@ static constexpr bool _isWheelMsg(const unsigned int buttonCode) noexcept } // Routine Description: -// - Determines if the input windows message code describes a button press -// (either down or doubleclick) +// - Determines if the input windows message code describes a button release // Parameters: // - button - the message to decode. // Return value: -// - true if button is a button down event -static constexpr bool _isButtonDown(const unsigned int button) noexcept +// - true if button is a button up event +static constexpr bool _isButtonUp(const unsigned int button) noexcept { switch (button) { - case WM_LBUTTONDBLCLK: - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_RBUTTONDBLCLK: - case WM_MBUTTONDOWN: - case WM_MBUTTONDBLCLK: - case WM_MOUSEWHEEL: - case WM_MOUSEHWHEEL: + case WM_LBUTTONUP: + case WM_RBUTTONUP: + case WM_MBUTTONUP: + case WM_XBUTTONUP: return true; default: return false; @@ -372,7 +367,7 @@ TerminalInput::OutputType TerminalInput::HandleMouse(const til::point position, // then we want to handle hovers with WM_MOUSEMOVE. // However, if we're dragging (WM_MOUSEMOVE with a button pressed), // then use that pressed button instead. - return _GenerateSGRSequence(position, physicalButtonPressed ? realButton : button, _isButtonDown(realButton), isHover, modifierKeyState, delta); + return _GenerateSGRSequence(position, physicalButtonPressed ? realButton : button, _isButtonUp(button), isHover, modifierKeyState, delta); } else { @@ -463,18 +458,18 @@ TerminalInput::OutputType TerminalInput::_GenerateUtf8Sequence(const til::point // Parameters: // - position - The windows coordinates (top,left = 0,0) of the mouse event // - button - the message to decode. WM_MOUSEMOVE is used for mouse hovers with no buttons pressed. -// - isDown - true if a mouse button was pressed. +// - isRelease - true if a mouse button was released. // - isHover - true if the sequence is generated in response to a mouse hover // - modifierKeyState - the modifier keys pressed with this button // - delta - the amount that the scroll wheel changed (should be 0 unless button is a WM_MOUSE*WHEEL) // - ppwchSequence - On success, where to put the pointer to the generated sequence // - pcchLength - On success, where to put the length of the generated sequence -TerminalInput::OutputType TerminalInput::_GenerateSGRSequence(const til::point position, const unsigned int button, const bool isDown, const bool isHover, const short modifierKeyState, const short delta) +TerminalInput::OutputType TerminalInput::_GenerateSGRSequence(const til::point position, const unsigned int button, const bool isRelease, const bool isHover, const short modifierKeyState, const short delta) { // Format for SGR events is: - // "\x1b[<%d;%d;%d;%c", xButton, x+1, y+1, fButtonDown? 'M' : 'm' + // "\x1b[<%d;%d;%d;%c", xButton, x+1, y+1, isRelease? 'm' : 'M' const auto xbutton = _windowsButtonToSGREncoding(button, isHover, modifierKeyState, delta); - return fmt::format(FMT_COMPILE(L"{}<{};{};{}{}"), _csi, xbutton, position.x + 1, position.y + 1, isDown ? L'M' : L'm'); + return fmt::format(FMT_COMPILE(L"{}<{};{};{}{}"), _csi, xbutton, position.x + 1, position.y + 1, isRelease ? L'm' : L'M'); } // Routine Description: diff --git a/src/terminal/input/terminalInput.hpp b/src/terminal/input/terminalInput.hpp index 4048826956..d9570cc9cc 100644 --- a/src/terminal/input/terminalInput.hpp +++ b/src/terminal/input/terminalInput.hpp @@ -109,7 +109,7 @@ namespace Microsoft::Console::VirtualTerminal #pragma region MouseInput [[nodiscard]] OutputType _GenerateDefaultSequence(til::point position, unsigned int button, bool isHover, short modifierKeyState, short delta); [[nodiscard]] OutputType _GenerateUtf8Sequence(til::point position, unsigned int button, bool isHover, short modifierKeyState, short delta); - [[nodiscard]] OutputType _GenerateSGRSequence(til::point position, unsigned int button, bool isDown, bool isHover, short modifierKeyState, short delta); + [[nodiscard]] OutputType _GenerateSGRSequence(til::point position, unsigned int button, bool isRelease, bool isHover, short modifierKeyState, short delta); [[nodiscard]] OutputType _makeAlternateScrollOutput(short delta) const; diff --git a/src/terminal/parser/ft_fuzzer/sources b/src/terminal/parser/ft_fuzzer/sources index a8c508a25d..c221ac9c0c 100644 --- a/src/terminal/parser/ft_fuzzer/sources +++ b/src/terminal/parser/ft_fuzzer/sources @@ -3,7 +3,7 @@ # - Console Virtual Terminal Parser Fuzzer # ------------------------------------- -!include $(PROJECT_ROOT)\vcpkg\consume.inc +!include ..\..\..\..\..\vcpkg\consume.inc # This program will generate fuzz input for the parsing engine # and is to be used in conjunction with the fuzz wrapper tool. @@ -27,6 +27,8 @@ TEST_CODE = 1 USE_UNICRT = 1 USE_MSVCRT = 1 +NO_WCHAR_T = 1 # use native wchar_t +USE_CXX17_STD_BYTE = 1 # Windows disables std::byte by default... USE_STL = 1 STL_VER = STL_VER_CURRENT @@ -47,6 +49,7 @@ C_DEFINES = $(C_DEFINES) -DUNICODE -D_UNICODE USE_STD_CPP20 = 1 MSC_WARNING_LEVEL = /W4 /WX +USER_C_FLAGS = $(USER_C_FLAGS) /Zc:preprocessor /fp:contract /utf-8 # ------------------------------------- # Build System Settings @@ -68,7 +71,6 @@ SOURCES = \ INCLUDES = \ ..\..\..\inc; \ $(CONSOLE_SRC_PATH)\..\oss\chromium; \ - $(CONSOLE_SRC_PATH)\..\oss\fmt\include; \ $(CONSOLE_SRC_PATH)\..\oss\interval_tree; \ $(INCLUDES) \ diff --git a/src/terminal/parser/ft_fuzzer/sources.dep b/src/terminal/parser/ft_fuzzer/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/parser/ft_fuzzer/sources.dep +++ b/src/terminal/parser/ft_fuzzer/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/parser/ft_fuzzwrapper/sources b/src/terminal/parser/ft_fuzzwrapper/sources index 1753a400e3..73df7091e4 100644 --- a/src/terminal/parser/ft_fuzzwrapper/sources +++ b/src/terminal/parser/ft_fuzzwrapper/sources @@ -60,6 +60,7 @@ INCLUDES = \ TARGETLIBS = \ $(TARGETLIBS) \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecore.lib \ $(OBJ_PATH)\..\lib\$(O)\ConTermParser.lib \ $(OBJ_PATH)\..\..\..\types\lib\$(O)\ConTypes.lib \ diff --git a/src/terminal/parser/ft_fuzzwrapper/sources.dep b/src/terminal/parser/ft_fuzzwrapper/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/parser/ft_fuzzwrapper/sources.dep +++ b/src/terminal/parser/ft_fuzzwrapper/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/parser/lib/sources.dep b/src/terminal/parser/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/parser/lib/sources.dep +++ b/src/terminal/parser/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/terminal/parser/ut_parser/sources b/src/terminal/parser/ut_parser/sources index fcc2178953..fd4e09dc3b 100644 --- a/src/terminal/parser/ut_parser/sources +++ b/src/terminal/parser/ut_parser/sources @@ -38,7 +38,7 @@ TARGETLIBS = \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\d3d11.lib \ $(ONECOREUAP_EXTERNAL_SDK_LIB_PATH)\d3dcompiler.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\api-ms-win-mm-playsound-l1.lib \ - $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1-1-0.lib \ + $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-imm-l1.lib \ $(ONECORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-dwmapi-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-gdi-dc-create-l1.lib \ @@ -63,12 +63,14 @@ TARGETLIBS = \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-sysparams-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-window-ext-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-winstamin-l1.lib \ + $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-rtcore-ntuser-syscolors-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-shell-shell32-l1.lib \ $(MINCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uxtheme-themes-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-dataobject-l1.lib \ $(ONECORESHELL_INTERNAL_LIB_VPATH_L)\api-ms-win-shell-namespace-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-uiacore-l1.lib \ $(MODERNCORE_INTERNAL_PRIV_SDK_LIB_VPATH_L)\ext-ms-win-usp10-l1.lib \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(WINCORE_OBJ_PATH)\console\conint\$(O)\conint.lib \ $(CONSOLE_OBJ_PATH)\buffer\out\lib\$(O)\conbufferout.lib \ $(CONSOLE_OBJ_PATH)\host\lib\$(O)\conhostv2.lib \ @@ -80,7 +82,6 @@ TARGETLIBS = \ $(CONSOLE_OBJ_PATH)\renderer\base\lib\$(O)\ConRenderBase.lib \ $(CONSOLE_OBJ_PATH)\renderer\gdi\lib\$(O)\ConRenderGdi.lib \ $(CONSOLE_OBJ_PATH)\renderer\wddmcon\lib\$(O)\ConRenderWddmCon.lib \ - $(CONSOLE_OBJ_PATH)\renderer\vt\lib\$(O)\ConRenderVt.lib \ $(CONSOLE_OBJ_PATH)\audio\midi\lib\$(O)\ConAudioMidi.lib \ $(CONSOLE_OBJ_PATH)\server\lib\$(O)\ConServer.lib \ $(CONSOLE_OBJ_PATH)\interactivity\base\lib\$(O)\ConInteractivityBaseLib.lib \ @@ -98,7 +99,7 @@ DELAYLOAD = \ OLEAUT32.dll; \ icu.dll; \ api-ms-win-mm-playsound-l1.dll; \ - ext-ms-win-imm-l1-1-0.lib; \ + ext-ms-win-imm-l1.dll; \ api-ms-win-shcore-scaling-l1.dll; \ api-ms-win-shell-dataobject-l1.dll; \ api-ms-win-shell-namespace-l1.dll; \ @@ -129,6 +130,7 @@ DELAYLOAD = \ ext-ms-win-rtcore-ntuser-sysparams-l1.dll; \ ext-ms-win-rtcore-ntuser-window-ext-l1.dll; \ ext-ms-win-rtcore-ntuser-winstamin-l1.dll; \ + ext-ms-win-rtcore-ntuser-syscolors-l1.dll; \ ext-ms-win-shell-shell32-l1.dll; \ ext-ms-win-uiacore-l1.dll; \ ext-ms-win-usp10-l1.dll; \ diff --git a/src/terminal/parser/ut_parser/sources.dep b/src/terminal/parser/ut_parser/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/terminal/parser/ut_parser/sources.dep +++ b/src/terminal/parser/ut_parser/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/til/ut_til/sources.dep b/src/til/ut_til/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/til/ut_til/sources.dep +++ b/src/til/ut_til/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/tools/vtpipeterm/main.cpp b/src/tools/vtpipeterm/main.cpp index fa79b0b9cf..3117f7aaaa 100644 --- a/src/tools/vtpipeterm/main.cpp +++ b/src/tools/vtpipeterm/main.cpp @@ -1,12 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #define NOMINMAX #include +#ifndef __INSIDE_WINDOWS #define CONPTY_IMPEXP #include +#else // Building inside Windows, just use the kernel32 ones. +#define ConptyCreatePseudoConsole CreatePseudoConsole +#define ConptyReleasePseudoConsole ReleasePseudoConsole +#define ConptyResizePseudoConsole ResizePseudoConsole +#endif #include diff --git a/src/tools/vtpipeterm/sources b/src/tools/vtpipeterm/sources index f19c0fe1ca..5fec40ebba 100644 --- a/src/tools/vtpipeterm/sources +++ b/src/tools/vtpipeterm/sources @@ -1,3 +1,6 @@ +!include $(PROJECT_ROOT)\core\console\vcpkg\consume.inc + +USE_STD_CPP20 = 1 MSC_WARNING_LEVEL=/W4 /WX @@ -18,8 +21,10 @@ USE_NATIVE_EH = 1 C_DEFINES=-DUNICODE -D__INSIDE_WINDOWS TARGETLIBS=\ + $(TARGETLIBS) \ $(MINWIN_EXTERNAL_SDK_LIB_PATH_L)\ntdll.lib \ - $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecore.lib + $(ONECORE_EXTERNAL_SDK_LIB_VPATH_L)\onecore.lib \ + $(WINCORE_OBJ_PATH)\console\open\src\types\lib\$(O)\ConTypes.lib \ SOURCES=main.cpp \ diff --git a/src/tsf/sources.dep b/src/tsf/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/tsf/sources.dep +++ b/src/tsf/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/types/lib/sources.dep b/src/types/lib/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/types/lib/sources.dep +++ b/src/types/lib/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \ diff --git a/src/types/ut_types/sources b/src/types/ut_types/sources index f5741649fe..e2fe087a64 100644 --- a/src/types/ut_types/sources +++ b/src/types/ut_types/sources @@ -25,6 +25,7 @@ INCLUDES = \ TARGETLIBS = \ $(WINCORE_OBJ_PATH)\console\open\src\types\lib\$(O)\ConTypes.lib \ + $(ONECORE_EXTERNAL_SDK_LIB_PATH)\ntdll.lib \ $(TARGETLIBS) \ # ------------------------------------- diff --git a/src/types/ut_types/sources.dep b/src/types/ut_types/sources.dep index bc61c95c6b..fce1139651 100644 --- a/src/types/ut_types/sources.dep +++ b/src/types/ut_types/sources.dep @@ -1,3 +1,3 @@ BUILD_PASS1_CONSUMES= \ - onecore\windows\vcpkg|PASS1 \ + onecore\windows\core\console\vcpkg|PASS1 \