From 177fd7458471434b28f99058ccd363e63845c10f Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett (MSFT)" Date: Mon, 11 May 2020 13:54:29 -0700 Subject: [PATCH] dx: when filling an HWND target, use the actual background color (#5848) There is no guarantee that the HWND's backing color matches our expected backing color. This repairs the gutter in the WPF terminal. --- src/renderer/dx/DxRenderer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/dx/DxRenderer.cpp b/src/renderer/dx/DxRenderer.cpp index 9a255f97633..1f2cbcdc7cf 100644 --- a/src/renderer/dx/DxRenderer.cpp +++ b/src/renderer/dx/DxRenderer.cpp @@ -1177,7 +1177,12 @@ CATCH_RETURN() [[nodiscard]] HRESULT DxEngine::PaintBackground() noexcept try { - D2D1_COLOR_F nothing = { 0 }; + D2D1_COLOR_F nothing{ 0 }; + if (_chainMode == SwapChainMode::ForHwnd) + { + // When we're drawing over an HWND target, we need to fully paint the background color. + nothing = _backgroundColor; + } // If the entire thing is invalid, just use one big clear operation. if (_invalidMap.all())