From 19ae26e7112fc83de7556b1d65f4fad268354de8 Mon Sep 17 00:00:00 2001 From: SoapyMan Date: Mon, 22 Apr 2024 21:47:16 +0500 Subject: [PATCH] Disable Alt-Enter tracking by DXGI on HWND window --- src/dawn/native/d3d/SwapChainD3D.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dawn/native/d3d/SwapChainD3D.cpp b/src/dawn/native/d3d/SwapChainD3D.cpp index 57b8502812c..b991a01d7ee 100644 --- a/src/dawn/native/d3d/SwapChainD3D.cpp +++ b/src/dawn/native/d3d/SwapChainD3D.cpp @@ -203,6 +203,11 @@ MaybeError SwapChain::InitializeSwapChainFromScratch() { static_cast(GetSurface()->GetHWND()), &swapChainDesc, nullptr, nullptr, &swapChain1), "Creating the IDXGISwapChain1")); + + const HRESULT mwaResult = factory2->MakeWindowAssociation(static_cast(GetSurface()->GetHWND()), DXGI_MWA_NO_ALT_ENTER); + if (mwaResult != DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { + DAWN_TRY(CheckHRESULT(mwaResult, "MakeWindowAssociation")); + } break; } case Surface::Type::WindowsCoreWindow: {