Commit a5af10e1 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Clear the focus and device windows on DDSCL_NORMAL.

parent 2ec0c7bf
...@@ -606,13 +606,6 @@ static HRESULT ddraw_set_focus_window(IDirectDrawImpl *ddraw, HWND window) ...@@ -606,13 +606,6 @@ static HRESULT ddraw_set_focus_window(IDirectDrawImpl *ddraw, HWND window)
/* Use the focus window for drawing too. */ /* Use the focus window for drawing too. */
ddraw->dest_window = ddraw->focuswindow; 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; return DD_OK;
} }
...@@ -828,6 +821,13 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, ...@@ -828,6 +821,13 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return DDERR_INVALIDPARAMS; 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) if ((This->cooperative_level & DDSCL_EXCLUSIVE)
&& (hwnd != window || !(cooplevel & DDSCL_EXCLUSIVE))) && (hwnd != window || !(cooplevel & DDSCL_EXCLUSIVE)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment