Commit cd9aa12a by James Ross-Gowan Committed by Commit Bot

D3D11: Prevent DXGI hooking the Alt+Enter keystroke

When ANGLE is using D3D11 and not using DirectComposition, DXGI will hook the window's message loop and override Alt+Enter to trigger a transition to exclusive fullscreen mode. This disables that behaviour, since it's inconsistent between backends and, at least during my testing, the application did not even work correctly after the transition to fullscreen mode. This commit should be similar to the workarounds implemented in Qt and mpv to prevent this behaviour and will hopefully make those workarounds unnecessary. Only the DXGI_MWA_NO_ALT_ENTER flag is used, since the other flags didn't seem to have an effect and probably only matter in fullscreen mode. BUG=angleproject:1414 Change-Id: Icb70c2c1405225619dcb27c5ffc9472fddd1157b Reviewed-on: https://chromium-review.googlesource.com/352950Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 989cac34
...@@ -44,3 +44,4 @@ Josh Soref ...@@ -44,3 +44,4 @@ Josh Soref
Maks Naumov Maks Naumov
Jinyoung Hur Jinyoung Hur
Sebastian Bergstein Sebastian Bergstein
James Ross-Gowan
...@@ -86,6 +86,7 @@ Jacek Caban ...@@ -86,6 +86,7 @@ Jacek Caban
Tibor den Ouden Tibor den Ouden
Régis Fénéon Régis Fénéon
Sebastian Bergstein Sebastian Bergstein
James Ross-Gowan
Microsoft Corporation Microsoft Corporation
Cooper Partin Cooper Partin
......
...@@ -166,6 +166,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device, ...@@ -166,6 +166,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
nullptr, nullptr, &swapChain1); nullptr, nullptr, &swapChain1);
if (SUCCEEDED(result)) if (SUCCEEDED(result))
{ {
factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
*swapChain = static_cast<IDXGISwapChain *>(swapChain1); *swapChain = static_cast<IDXGISwapChain *>(swapChain1);
} }
SafeRelease(factory2); SafeRelease(factory2);
...@@ -190,7 +191,12 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device, ...@@ -190,7 +191,12 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
swapChainDesc.Windowed = TRUE; swapChainDesc.Windowed = TRUE;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
return factory->CreateSwapChain(device, &swapChainDesc, swapChain); HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
if (SUCCEEDED(result))
{
factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
}
return result;
} }
void NativeWindow11Win32::commitChange() void NativeWindow11Win32::commitChange()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment