diff --git a/backends/imgui_impl_dx10.cpp b/backends/imgui_impl_dx10.cpp index dd427d335..15ccf1e7c 100644 --- a/backends/imgui_impl_dx10.cpp +++ b/backends/imgui_impl_dx10.cpp @@ -708,6 +708,7 @@ static void ImGui_ImplDX10_CreateWindow(ImGuiViewport* viewport) IM_ASSERT(vd->SwapChain == nullptr && vd->RTView == nullptr); bd->pFactory->CreateSwapChain(bd->pd3dDevice, &sd, &vd->SwapChain); + bd->pFactory->MakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER | DXGI_MWA_NO_WINDOW_CHANGES); // Disable e.g. Alt+Enter // Create the render target if (vd->SwapChain) diff --git a/backends/imgui_impl_dx11.cpp b/backends/imgui_impl_dx11.cpp index a50207749..69eecf047 100644 --- a/backends/imgui_impl_dx11.cpp +++ b/backends/imgui_impl_dx11.cpp @@ -738,6 +738,7 @@ static void ImGui_ImplDX11_CreateWindow(ImGuiViewport* viewport) break; } IM_ASSERT(SUCCEEDED(hr)); + bd->pFactory->MakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER | DXGI_MWA_NO_WINDOW_CHANGES); // Disable e.g. Alt+Enter // Create the render target if (vd->SwapChain != nullptr) diff --git a/backends/imgui_impl_dx12.cpp b/backends/imgui_impl_dx12.cpp index 7e13971e5..a224469d8 100644 --- a/backends/imgui_impl_dx12.cpp +++ b/backends/imgui_impl_dx12.cpp @@ -1087,6 +1087,8 @@ static void ImGui_ImplDX12_CreateWindow(ImGuiViewport* viewport) IDXGISwapChain1* swap_chain = nullptr; res = dxgi_factory->CreateSwapChainForHwnd(vd->CommandQueue, hwnd, &sd1, nullptr, nullptr, &swap_chain); IM_ASSERT(res == S_OK); + res = dxgi_factory->MakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER | DXGI_MWA_NO_WINDOW_CHANGES); // Disable e.g. Alt+Enter + IM_ASSERT(res == S_OK); dxgi_factory->Release(); diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 6d7a8f98e..3326f800c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -88,6 +88,8 @@ Docking+Viewports Branch: - Viewports: DestroyContext() does not call DestroyPlatformWindows() anymore at it assumed to be unnecessary as backensd should have done it and we check that backends have been shutdown since 1.90.4. Changed into asserts. (#7175, #8945) +- Backends: DX10, DX11, DX12: Disabled DXGI's Alt+Enter default behavior on secondary + viewports managed by the backend. (#4350) [@PathogenDavid] - Backends: Vulkan: Added ImGui_ImplVulkanH_GetWindowDataFromViewport() accessor/helper. (#8946, #8940) [@olivier-gerard]