ddraw: Clear the focus and device windows on DDSCL_NORMAL.

This commit is contained in:
Henri Verbeet 2011-12-22 21:51:19 +01:00 committed by Alexandre Julliard
parent 2ec0c7bfdc
commit a5af10e12b
1 changed files with 7 additions and 7 deletions

View File

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