wined3d: Store the device window in the swapchain.
authorHenri Verbeet <hverbeet@codeweavers.com>
Mon, 15 Mar 2010 20:07:30 +0000 (21:07 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 16 Mar 2010 10:45:11 +0000 (11:45 +0100)
The swapchain's current window might be changed by SetDestWindowOverride().

dlls/wined3d/device.c
dlls/wined3d/swapchain.c
dlls/wined3d/swapchain_base.c
dlls/wined3d/wined3d_private.h

index 239e2f44afb08aadd8596f322201ae235884c468..4a0c2df1afbb90fe4cc379aa7b70b90b06567a72 100644 (file)
@@ -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);
             }
index d0ccd0ffc5ab88d272a9aeee1814bbf03b5cd83f..43a0713aebe7739165eca2d456a55eb0516ade38 100644 (file)
@@ -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)
     {
index 4c0590e4691589e4168cac3fee4d5892468d08d8..f1fde3e6fe58d90dfe2ccff798daa20d8707c7f6 100644 (file)
@@ -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;
 
 }
index 40e0ad28fb3ac6b776acea7830272cbe43dbd820..66a7afac91440071cfbee6d84656e5768986981f 100644 (file)
@@ -2553,6 +2553,7 @@ struct IWineD3DSwapChainImpl
     unsigned int            num_contexts;
 
     HWND                    win_handle;
+    HWND device_window;
 };
 
 const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl DECLSPEC_HIDDEN;