[PATCH 2/5] ddraw: Clear the focus and device windows on DDSCL_NORMAL.

Henri Verbeet hverbeet at codeweavers.com
Thu Dec 22 14:51:19 CST 2011


---
 dlls/ddraw/ddraw.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 52015c1..112240d 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -606,13 +606,6 @@ static HRESULT ddraw_set_focus_window(IDirectDrawImpl *ddraw, HWND window)
     /* Use the focus window for drawing too. */
     ddraw->dest_window = ddraw->focuswindow;
 
-    /* Destroy the device window, if we have one. */
-    if (ddraw->devicewindow)
-    {
-        DestroyWindow(ddraw->devicewindow);
-        ddraw->devicewindow = NULL;
-    }
-
     return DD_OK;
 }
 
@@ -828,6 +821,13 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
             return DDERR_INVALIDPARAMS;
         }
     }
+    else
+    {
+        if (This->cooperative_level & DDSCL_CREATEDEVICEWINDOW)
+            DestroyWindow(This->devicewindow);
+        This->devicewindow = NULL;
+        This->focuswindow = NULL;
+    }
 
     if ((This->cooperative_level & DDSCL_EXCLUSIVE)
             && (hwnd != window || !(cooplevel & DDSCL_EXCLUSIVE)))
-- 
1.7.3.4




More information about the wine-patches mailing list