From 9fa163c4f47355fc3f4940e1c966aa93ba0c64e3 Mon Sep 17 00:00:00 2001 From: Matijn Woudt Date: Tue, 23 Nov 2010 23:51:06 +0100 Subject: d3d9: Create dummy window if focus window is the desktop window --- dlls/d3d9/Makefile.in | 2 +- dlls/d3d9/d3d9_private.h | 2 ++ dlls/d3d9/device.c | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletions(-) diff --git a/dlls/d3d9/Makefile.in b/dlls/d3d9/Makefile.in index 9d5a4d8..ed949d3 100644 --- a/dlls/d3d9/Makefile.in +++ b/dlls/d3d9/Makefile.in @@ -1,6 +1,6 @@ MODULE = d3d9.dll IMPORTLIB = d3d9 -IMPORTS = dxguid uuid wined3d +IMPORTS = dxguid uuid wined3d user32 C_SRCS = \ buffer.c \ diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 02f9c20..7d8d45e 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -178,6 +178,8 @@ typedef struct IDirect3DDevice9Impl unsigned int numConvertedDecls, declArraySize; BOOL notreset; + + HWND dummy_window; } IDirect3DDevice9Impl; HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type, diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 349bde4..ddf431d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -275,6 +275,7 @@ static ULONG WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_Release(LPDIRECT3DDEV IWineD3DDevice_ReleaseFocusWindow(This->WineD3DDevice); IWineD3DDevice_Release(This->WineD3DDevice); wined3d_mutex_unlock(); + if(This->dummy_window) DestroyWindow(This->dummy_window); HeapFree(GetProcessHeap(), 0, This); } @@ -3255,6 +3256,17 @@ HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapte device->device_parent_vtbl = &d3d9_wined3d_device_parent_vtbl; device->ref = 1; + if(focus_window == GetDesktopWindow()) { + WNDCLASSA wc = {0}; + wc.lpfnWndProc = DefWindowProcA; + wc.lpszClassName = "wine_d3d9_dummy_window"; + RegisterClassA(&wc); + + focus_window = CreateWindowA("wine_d3d9_dummy_window", "wine_d3d9_dummy_window", WS_POPUP, 0, 0, 640, 480, 0, 0, 0, 0); + parameters->hDeviceWindow = focus_window; + device->dummy_window = focus_window; + } + if (!(flags & D3DCREATE_FPU_PRESERVE)) setup_fpu(); wined3d_mutex_lock(); -- 1.7.0.4