Henri Verbeet : ddraw: Clear the focus and device windows on DDSCL_NORMAL.

Alexandre Julliard julliard at winehq.org
Fri Dec 23 13:03:22 CST 2011


Module: wine
Branch: master
Commit: a5af10e12bd1ef0517ec60dde47c30136d45d9bd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a5af10e12bd1ef0517ec60dde47c30136d45d9bd

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Dec 22 21:51:19 2011 +0100

ddraw: Clear the focus and device windows on DDSCL_NORMAL.

---

 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)))




More information about the wine-cvs mailing list