From 7b4d4ff86a9d26ac6f5cf61e6549eae29ade6b1a Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Thu, 23 Oct 2003 19:39:00 +0000 Subject: [PATCH] clip the cursor while moving/sizing windows svn path=/trunk/; revision=6419 --- reactos/lib/user32/windows/defwnd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index 7ce7aaabd5f..25ca1d491d1 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.100 2003/10/19 19:51:48 navaraf Exp $ +/* $Id: defwnd.c,v 1.101 2003/10/23 19:39:00 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -1304,7 +1304,7 @@ VOID STATIC DefWndDoSizeMove(HWND hwnd, WORD wParam) { MSG msg; - RECT sizingRect, mouseRect, origRect; + RECT sizingRect, mouseRect, origRect, clipRect; HDC hdc; LONG hittest = (LONG)(wParam & 0x0f); HCURSOR hDragCursor = 0, hOldCursor = 0; @@ -1376,12 +1376,17 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) { MapWindowPoints( 0, hWndParent, (LPPOINT)&sizingRect, 2 ); GetClientRect(hWndParent, &mouseRect ); + clipRect = mouseRect; + MapWindowPoints(hWndParent, HWND_DESKTOP, (LPPOINT)&clipRect, 2); } else { SetRect(&mouseRect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); + SystemParametersInfoW(SPI_GETWORKAREA, 0, &clipRect, 0); } + ClipCursor(&clipRect); + origRect = sizingRect; if (ON_LEFT_BORDER(hittest)) { @@ -1527,6 +1532,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) } ReleaseCapture(); + ClipCursor(NULL); if( iconic ) { if( moved ) /* restore cursors, show icon title later on */