mirror of
https://github.com/reactos/reactos.git
synced 2025-06-07 18:30:37 +00:00
[NTUSER] Avoid sending superfluous WM_MOUSEMOVE messages (#6397)
Add a check so that mouse move messages are not generated unless the mouse cursor X or Y position is changed. This fixes extra mouse moves generated when clicking. Patch by I_Kill_Bugs. CORE-8394 CORE-18529 CORE-19422 CORE-19423
This commit is contained in:
parent
31ce37da2a
commit
76290a6696
1 changed files with 9 additions and 7 deletions
|
@ -264,13 +264,15 @@ BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Ho
|
||||||
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. */
|
/* 1. Generate a mouse move message, this sets the htEx and Track Window too. */
|
||||||
Msg.message = WM_MOUSEMOVE;
|
Msg.message = WM_MOUSEMOVE;
|
||||||
Msg.wParam = UserGetMouseButtonsState();
|
Msg.wParam = UserGetMouseButtonsState();
|
||||||
Msg.lParam = MAKELPARAM(x, y);
|
Msg.lParam = MAKELPARAM(x, y);
|
||||||
Msg.pt = pt;
|
Msg.pt = pt;
|
||||||
co_MsqInsertMouseMessage(&Msg, flags, dwExtraInfo, Hook);
|
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