Commit 2a63a03e authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

wined3d: When changing display modes clip cursor to the requested display size.

parent 4d8135e0
......@@ -146,7 +146,27 @@ static void setdisplaymode(int i)
modes[i].dwWidth, modes[i].dwHeight,
U1(modes[i].ddpfPixelFormat).dwRGBBitCount);
ok(DD_OK==rc || DDERR_UNSUPPORTED==rc,"SetDisplayMode returned: %x\n",rc);
if (DD_OK==rc) {
if (rc == DD_OK)
{
RECT r, scrn, virt;
SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN));
OffsetRect(&virt, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN));
SetRect(&scrn, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
trace("Mode (%dx%d) [%dx%d] (%d %d)x(%d %d)\n", modes[i].dwWidth, modes[i].dwHeight,
scrn.right, scrn.bottom, virt.left, virt.top, virt.right, virt.bottom);
ok(GetClipCursor(&r), "GetClipCursor() failed\n");
/* ddraw sets clip rect here to the screen size, even for
multiple monitors */
ok(EqualRect(&r, &scrn), "Invalid clip rect: (%d %d) x (%d %d)\n",
r.left, r.top, r.right, r.bottom);
ok(ClipCursor(NULL), "ClipCursor() failed\n");
ok(GetClipCursor(&r), "GetClipCursor() failed\n");
ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n",
r.left, r.top, r.right, r.bottom);
rc = IDirectDraw_RestoreDisplayMode(lpDD);
ok(DD_OK==rc,"RestoreDisplayMode returned: %x\n",rc);
}
......
......@@ -2254,6 +2254,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDisplayMode(IWineD3DDevice *iface, U
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
LONG ret;
const PixelFormatDesc *formatDesc = getFormatDescEntry(pMode->Format);
RECT clip_rc;
TRACE("(%p)->(%d,%p) Mode=%dx%dx@%d, %s\n", This, iSwapChain, pMode, pMode->Width, pMode->Height, pMode->RefreshRate, debug_d3dformat(pMode->Format));
......@@ -2304,6 +2305,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDisplayMode(IWineD3DDevice *iface, U
if(This->ddraw_window)
MoveWindow(This->ddraw_window, 0, 0, pMode->Width, pMode->Height, TRUE);
/* And finally clip mouse to our screen */
SetRect(&clip_rc, 0, 0, pMode->Width, pMode->Height);
ClipCursor(&clip_rc);
return WINED3D_OK;
}
......
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