d3d8: CreateDevice should try the parent if the current window fails

Jan Zerebecki jan.wine at zerebecki.de
Tue Jan 24 03:28:19 CST 2006


If this patch is rejected from inclusion, please tell me why, as i would have to
ask anyway.

From: Jan Zerebecki <jan.wine at zerebecki.de>
Changelog:
d3d8: CreateDevice should try the parent if the current window fails
because it doesn't have the property __wine_x11_whole_window .
Fixes bug #4341 .
---

 dlls/d3d8/directx.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index a324855..4f3107c 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -714,7 +714,17 @@ HRESULT  WINAPI  IDirect3D8Impl_CreateDe
         whichHWND = hFocusWindow;
     }
     object->win_handle = whichHWND;
-    object->win     = (Window)GetPropA( whichHWND, "__wine_x11_whole_window" );
+    while ( !( object->win = (Window)GetPropA(whichHWND, "__wine_x11_whole_window") ) )
+    {
+        if( !( whichHWND = GetParent(whichHWND) ) )
+        {
+            whichHWND = object->win_handle;
+            FIXME("HWND:%p doesn't have property __wine_x11_whole_window\n", whichHWND);
+            break;
+        }
+        object->win_handle = whichHWND;
+        TRACE("HWND:%p doesn't have __wine_x11_whole_window, trying parent %p\n", object->win_handle, whichHWND);
+    }
 
     hDc = GetDC(whichHWND);
     object->display = get_display(hDc);



More information about the wine-patches mailing list