Commit cd9a8b74 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Store the device window in the swapchain.

The swapchain's current window might be changed by SetDestWindowOverride().
parent aa819fe8
...@@ -6632,7 +6632,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE ...@@ -6632,7 +6632,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
pPresentationParameters->BackBufferHeight); pPresentationParameters->BackBufferHeight);
} else { } else {
/* Fullscreen -> fullscreen mode change */ /* Fullscreen -> fullscreen mode change */
MoveWindow(swapchain->win_handle, 0, 0, MoveWindow(swapchain->device_window, 0, 0,
pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight,
TRUE); TRUE);
} }
......
...@@ -598,7 +598,7 @@ static LONG fullscreen_exstyle(LONG exstyle) ...@@ -598,7 +598,7 @@ static LONG fullscreen_exstyle(LONG exstyle)
void swapchain_setup_fullscreen_window(IWineD3DSwapChainImpl *swapchain, UINT w, UINT h) void swapchain_setup_fullscreen_window(IWineD3DSwapChainImpl *swapchain, UINT w, UINT h)
{ {
IWineD3DDeviceImpl *device = swapchain->device; IWineD3DDeviceImpl *device = swapchain->device;
HWND window = swapchain->win_handle; HWND window = swapchain->device_window;
BOOL filter_messages; BOOL filter_messages;
LONG style, exstyle; LONG style, exstyle;
...@@ -632,7 +632,7 @@ void swapchain_setup_fullscreen_window(IWineD3DSwapChainImpl *swapchain, UINT w, ...@@ -632,7 +632,7 @@ void swapchain_setup_fullscreen_window(IWineD3DSwapChainImpl *swapchain, UINT w,
void swapchain_restore_fullscreen_window(IWineD3DSwapChainImpl *swapchain) void swapchain_restore_fullscreen_window(IWineD3DSwapChainImpl *swapchain)
{ {
IWineD3DDeviceImpl *device = swapchain->device; IWineD3DDeviceImpl *device = swapchain->device;
HWND window = swapchain->win_handle; HWND window = swapchain->device_window;
BOOL filter_messages; BOOL filter_messages;
LONG style, exstyle; LONG style, exstyle;
...@@ -712,6 +712,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface ...@@ -712,6 +712,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
swapchain->parent = parent; swapchain->parent = parent;
swapchain->ref = 1; swapchain->ref = 1;
swapchain->win_handle = window; swapchain->win_handle = window;
swapchain->device_window = window;
if (!present_parameters->Windowed && window) if (!present_parameters->Windowed && window)
{ {
......
...@@ -171,9 +171,9 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_SetGammaRamp(IWineD3DSwapChain *iface, ...@@ -171,9 +171,9 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_SetGammaRamp(IWineD3DSwapChain *iface,
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
HDC hDC; HDC hDC;
TRACE("(%p) : pRamp@%p flags(%d)\n", This, pRamp, Flags); TRACE("(%p) : pRamp@%p flags(%d)\n", This, pRamp, Flags);
hDC = GetDC(This->win_handle); hDC = GetDC(This->device_window);
SetDeviceGammaRamp(hDC, (LPVOID)pRamp); SetDeviceGammaRamp(hDC, (LPVOID)pRamp);
ReleaseDC(This->win_handle, hDC); ReleaseDC(This->device_window, hDC);
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -183,9 +183,9 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, ...@@ -183,9 +183,9 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface,
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
HDC hDC; HDC hDC;
TRACE("(%p) : pRamp@%p\n", This, pRamp); TRACE("(%p) : pRamp@%p\n", This, pRamp);
hDC = GetDC(This->win_handle); hDC = GetDC(This->device_window);
GetDeviceGammaRamp(hDC, pRamp); GetDeviceGammaRamp(hDC, pRamp);
ReleaseDC(This->win_handle, hDC); ReleaseDC(This->device_window, hDC);
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -2553,6 +2553,7 @@ struct IWineD3DSwapChainImpl ...@@ -2553,6 +2553,7 @@ struct IWineD3DSwapChainImpl
unsigned int num_contexts; unsigned int num_contexts;
HWND win_handle; HWND win_handle;
HWND device_window;
}; };
const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl DECLSPEC_HIDDEN; const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl DECLSPEC_HIDDEN;
......
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