Module: wine Branch: master Commit: 2b0684c56db343112d845e0b277bf831f6b578df URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b0684c56db343112d845e0b27...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Nov 10 10:53:02 2010 +0100
ddraw: Make switching to/from fullscreen work more than once.
---
dlls/ddraw/ddraw.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index e155482..b9ff201 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -647,15 +647,12 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, && (hwnd != window || !(cooplevel & DDSCL_EXCLUSIVE))) IWineD3DDevice_ReleaseFocusWindow(This->wineD3DDevice);
- /* Do we switch from fullscreen to non-fullscreen ? */ - if (!(cooplevel & DDSCL_FULLSCREEN) && (This->cooperative_level & DDSCL_FULLSCREEN)) - { - IWineD3DDevice_RestoreFullscreenWindow(This->wineD3DDevice, This->dest_window); - } - - /* Don't override focus windows or private device windows */ - if (hwnd && !This->focuswindow && !This->devicewindow && (hwnd != window)) + if ((cooplevel & DDSCL_FULLSCREEN) != (This->cooperative_level & DDSCL_FULLSCREEN) || hwnd != window) { + if (This->cooperative_level & DDSCL_FULLSCREEN) + { + IWineD3DDevice_RestoreFullscreenWindow(This->wineD3DDevice, window); + } if (cooplevel & DDSCL_FULLSCREEN) { WINED3DDISPLAYMODE display_mode; @@ -663,7 +660,6 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, IWineD3D_GetAdapterDisplayMode(This->wineD3D, WINED3DADAPTER_DEFAULT, &display_mode); IWineD3DDevice_SetupFullscreenWindow(This->wineD3DDevice, hwnd, display_mode.Width, display_mode.Height); } - This->dest_window = hwnd; }
if ((cooplevel & DDSCL_EXCLUSIVE) @@ -678,6 +674,10 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, } }
+ /* Don't override focus windows or private device windows */ + if (hwnd && !This->focuswindow && !This->devicewindow && (hwnd != window)) + This->dest_window = hwnd; + if(cooplevel & DDSCL_CREATEDEVICEWINDOW) { /* Don't create a device window if a focus window is set */