Skip to content

Commit

Permalink
Fix MakeWindowAssociation so alt-enter is actually disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kg authored and flibitijibibo committed Nov 1, 2020
1 parent 5b736d1 commit c6a24de
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/FNA3D_Driver_D3D11.c
Original file line number Diff line number Diff line change
Expand Up @@ -5022,9 +5022,24 @@ static void D3D11_PLATFORM_CreateSwapChain(
);
ERROR_CHECK("Could not create swapchain")

/*
* The swapchain's parent is a separate factory from the factory that
* we used to create the swapchain, and only that parent can be used to
* set the window association. Trying to set an association on our factory
* will silently fail and doesn't even verify arguments or return errors.
* See https://gamedev.net/forums/topic/634235-dxgidisabling-altenter/4999955/
*/
IDXGIFactory1* pParent;
res = IDXGISwapChain_GetParent(
(IDXGISwapChain *) renderer->swapchain,
&D3D_IID_IDXGIFactory1,
&pParent
);
ERROR_CHECK("Could not get swapchain parent")

/* Disable DXGI window crap */
res = IDXGIFactory_MakeWindowAssociation(
(IDXGIFactory*) renderer->factory,
res = IDXGIFactory1_MakeWindowAssociation(
pParent,
dxgiHandle,
DXGI_MWA_NO_WINDOW_CHANGES
);
Expand Down

0 comments on commit c6a24de

Please sign in to comment.