mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 22:52:58 +00:00
[win32k]
- Revert changes done in 47325 which partially broke mouse hooks. - If the UserSetCursorPos is reached due to SetCursorPos, dont generate a mouse move message or call mouse hooks. svn path=/trunk/; revision=47924
This commit is contained in:
parent
f403974604
commit
e769090231
2 changed files with 35 additions and 34 deletions
|
@ -175,11 +175,10 @@ UserSetCursor(
|
||||||
return hOldCursor;
|
return hOldCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL UserSetCursorPos( INT x, INT y, BOOL CallHooks)
|
BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT DesktopWindow;
|
PWINDOW_OBJECT DesktopWindow;
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
MSLLHOOKSTRUCT MouseHookData;
|
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
|
|
||||||
|
@ -225,44 +224,16 @@ BOOL UserSetCursorPos( INT x, INT y, BOOL CallHooks)
|
||||||
//Move the mouse pointer
|
//Move the mouse pointer
|
||||||
GreMovePointer(hDC, x, y);
|
GreMovePointer(hDC, x, y);
|
||||||
|
|
||||||
|
if (!SendMouseMoveMsg)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
//Generate a mouse move message
|
//Generate a mouse move message
|
||||||
Msg.message = WM_MOUSEMOVE;
|
Msg.message = WM_MOUSEMOVE;
|
||||||
Msg.wParam = CurInfo->ButtonsDown;
|
Msg.wParam = CurInfo->ButtonsDown;
|
||||||
Msg.lParam = MAKELPARAM(x, y);
|
Msg.lParam = MAKELPARAM(x, y);
|
||||||
Msg.pt = gpsi->ptCursor;
|
Msg.pt = gpsi->ptCursor;
|
||||||
|
|
||||||
MouseHookData.pt.x = LOWORD(Msg.lParam);
|
|
||||||
MouseHookData.pt.y = HIWORD(Msg.lParam);
|
|
||||||
switch(Msg.message)
|
|
||||||
{
|
|
||||||
case WM_MOUSEWHEEL:
|
|
||||||
MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg.wParam));
|
|
||||||
break;
|
|
||||||
case WM_XBUTTONDOWN:
|
|
||||||
case WM_XBUTTONUP:
|
|
||||||
case WM_XBUTTONDBLCLK:
|
|
||||||
case WM_NCXBUTTONDOWN:
|
|
||||||
case WM_NCXBUTTONUP:
|
|
||||||
case WM_NCXBUTTONDBLCLK:
|
|
||||||
MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg.wParam));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
MouseHookData.mouseData = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseHookData.flags = 0;
|
|
||||||
MouseHookData.time = Msg.time;
|
|
||||||
MouseHookData.dwExtraInfo = 0;
|
|
||||||
|
|
||||||
if (CallHooks)
|
|
||||||
{
|
|
||||||
/* If the hook procedure returned non zero, dont send the message */
|
|
||||||
if (co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg.message, (LPARAM) &MouseHookData))
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
MsqInsertSystemMessage(&Msg);
|
MsqInsertSystemMessage(&Msg);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,9 +174,39 @@ MsqInsertSystemMessage(MSG* Msg)
|
||||||
LARGE_INTEGER LargeTickCount;
|
LARGE_INTEGER LargeTickCount;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
ULONG Prev;
|
ULONG Prev;
|
||||||
|
MSLLHOOKSTRUCT MouseHookData;
|
||||||
|
|
||||||
KeQueryTickCount(&LargeTickCount);
|
KeQueryTickCount(&LargeTickCount);
|
||||||
Msg->time = MsqCalculateMessageTime(&LargeTickCount);
|
Msg->time = MsqCalculateMessageTime(&LargeTickCount);
|
||||||
|
|
||||||
|
MouseHookData.pt.x = LOWORD(Msg->lParam);
|
||||||
|
MouseHookData.pt.y = HIWORD(Msg->lParam);
|
||||||
|
switch(Msg->message)
|
||||||
|
{
|
||||||
|
case WM_MOUSEWHEEL:
|
||||||
|
MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg->wParam));
|
||||||
|
break;
|
||||||
|
case WM_XBUTTONDOWN:
|
||||||
|
case WM_XBUTTONUP:
|
||||||
|
case WM_XBUTTONDBLCLK:
|
||||||
|
case WM_NCXBUTTONDOWN:
|
||||||
|
case WM_NCXBUTTONUP:
|
||||||
|
case WM_NCXBUTTONDBLCLK:
|
||||||
|
MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg->wParam));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
MouseHookData.mouseData = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseHookData.flags = 0;
|
||||||
|
MouseHookData.time = Msg->time;
|
||||||
|
MouseHookData.dwExtraInfo = 0;
|
||||||
|
|
||||||
|
/* If the hook procedure returned non zero, dont send the message */
|
||||||
|
if (co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg->message, (LPARAM) &MouseHookData))
|
||||||
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we got WM_MOUSEMOVE and there are already messages in the
|
* If we got WM_MOUSEMOVE and there are already messages in the
|
||||||
* system message queue, check if the last message is mouse move
|
* system message queue, check if the last message is mouse move
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue