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