Module: wine Branch: master Commit: cd9a8b74b9259db892e9f9746f54a791298dd6dc URL: http://source.winehq.org/git/wine.git/?a=commit;h=cd9a8b74b9259db892e9f9746f...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Mar 15 21:07:30 2010 +0100
wined3d: Store the device window in the swapchain.
The swapchain's current window might be changed by SetDestWindowOverride().
---
dlls/wined3d/device.c | 2 +- dlls/wined3d/swapchain.c | 5 +++-- dlls/wined3d/swapchain_base.c | 8 ++++---- dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 239e2f4..4a0c2df 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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); } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index d0ccd0f..43a0713 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -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) { diff --git a/dlls/wined3d/swapchain_base.c b/dlls/wined3d/swapchain_base.c index 4c0590e..f1fde3e 100644 --- a/dlls/wined3d/swapchain_base.c +++ b/dlls/wined3d/swapchain_base.c @@ -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;
} diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 40e0ad2..66a7afa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2553,6 +2553,7 @@ struct IWineD3DSwapChainImpl unsigned int num_contexts;
HWND win_handle; + HWND device_window; };
const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl DECLSPEC_HIDDEN;