diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 04f56b8aa28..e8df4f0adc4 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -305,6 +305,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DD localParameters.Flags = pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval; + localParameters.AutoRestoreDisplayMode = TRUE; EnterCriticalSection(&d3d8_cs); hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D8CB_CreateRenderTarget, D3D8CB_CreateDepthStencilSurface, SURFACE_OPENGL); @@ -358,6 +359,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRE localParameters.Flags = pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval; + localParameters.AutoRestoreDisplayMode = TRUE; EnterCriticalSection(&d3d8_cs); hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters); diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index afcb0fe38d5..3efbab09b16 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -444,6 +444,7 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapte localParameters.Flags = pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval; + localParameters.AutoRestoreDisplayMode = TRUE; if(BehaviourFlags & D3DCREATE_MULTITHREADED) { IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 8aab2307819..426c8ab3872 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -376,6 +376,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9EX iface, D3 localParameters.Flags = pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = pPresentationParameters->PresentationInterval; + localParameters.AutoRestoreDisplayMode = TRUE; EnterCriticalSection(&d3d9_cs); hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters); diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index b605f44da7a..b44c6324ec3 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -515,6 +515,7 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap localParameters.Flags = pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = pPresentationParameters->PresentationInterval; + localParameters.AutoRestoreDisplayMode = TRUE; if(BehaviourFlags & D3DCREATE_MULTITHREADED) { IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 74e1cf6341f..6f4393ae0c6 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -72,7 +72,7 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB * this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution * before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params */ - if(This->presentParms.Windowed == FALSE) { + if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) { mode.Width = This->orig_width; mode.Height = This->orig_height; mode.RefreshRate = 0; diff --git a/dlls/wined3d/swapchain_gdi.c b/dlls/wined3d/swapchain_gdi.c index f0ec4f2fad0..f634e50c146 100644 --- a/dlls/wined3d/swapchain_gdi.c +++ b/dlls/wined3d/swapchain_gdi.c @@ -59,7 +59,7 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB * this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution * before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params */ - if(This->presentParms.Windowed == FALSE) { + if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) { mode.Width = This->orig_width; mode.Height = This->orig_height; mode.RefreshRate = 0; diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 4ccbcabce6e..28e5525c5f6 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -886,6 +886,7 @@ typedef struct _WINED3DPRESENT_PARAMETERS { DWORD Flags; UINT FullScreen_RefreshRateInHz; UINT PresentationInterval; + BOOL AutoRestoreDisplayMode; } WINED3DPRESENT_PARAMETERS; #define WINED3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001