mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTUSER] UserSetCursorPos(): Use an early return
Addendum to 76290a6
(0.4.15-dev-7889).
This commit is contained in:
parent
8b9bf3369c
commit
fd331f1494
1 changed files with 11 additions and 9 deletions
|
@ -261,18 +261,20 @@ BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Ho
|
||||||
if (y >= rcClip.bottom) y = rcClip.bottom - 1;
|
if (y >= rcClip.bottom) y = rcClip.bottom - 1;
|
||||||
if (y < rcClip.top) y = rcClip.top;
|
if (y < rcClip.top) y = rcClip.top;
|
||||||
|
|
||||||
|
/* Nothing to do if position did not actually change */
|
||||||
|
if (x == gpsi->ptCursor.x && y == gpsi->ptCursor.y)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
pt.x = x;
|
pt.x = x;
|
||||||
pt.y = y;
|
pt.y = y;
|
||||||
|
|
||||||
if ((gpsi->ptCursor.x != x) || (gpsi->ptCursor.y != y))
|
/* 1. Generate a mouse move message, this sets the htEx and Track Window too */
|
||||||
{
|
Msg.message = WM_MOUSEMOVE;
|
||||||
/* 1. Generate a mouse move message, this sets the htEx and Track Window too. */
|
Msg.wParam = UserGetMouseButtonsState();
|
||||||
Msg.message = WM_MOUSEMOVE;
|
Msg.lParam = MAKELPARAM(x, y);
|
||||||
Msg.wParam = UserGetMouseButtonsState();
|
Msg.pt = pt;
|
||||||
Msg.lParam = MAKELPARAM(x, y);
|
co_MsqInsertMouseMessage(&Msg, flags, dwExtraInfo, Hook);
|
||||||
Msg.pt = pt;
|
|
||||||
co_MsqInsertMouseMessage(&Msg, flags, dwExtraInfo, Hook);
|
|
||||||
}
|
|
||||||
/* 2. Store the new cursor position */
|
/* 2. Store the new cursor position */
|
||||||
gpsi->ptCursor = pt;
|
gpsi->ptCursor = pt;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue