diff --git a/reactos/subsystems/win32/win32k/include/msgqueue.h b/reactos/subsystems/win32/win32k/include/msgqueue.h index 637e236c087..234d0b59eeb 100644 --- a/reactos/subsystems/win32/win32k/include/msgqueue.h +++ b/reactos/subsystems/win32/win32k/include/msgqueue.h @@ -197,6 +197,8 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam); VOID FASTCALL MsqInsertSystemMessage(MSG* Msg); BOOL FASTCALL +MsqIsClkLck(LPMSG Msg, BOOL Remove); +BOOL FASTCALL MsqIsDblClk(LPMSG Msg, BOOL Remove); HWND FASTCALL MsqSetStateWindow(PUSER_MESSAGE_QUEUE MessageQueue, ULONG Type, HWND hWnd); diff --git a/reactos/subsystems/win32/win32k/ntuser/message.c b/reactos/subsystems/win32/win32k/ntuser/message.c index a2857f58899..c9681928a7b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/message.c +++ b/reactos/subsystems/win32/win32k/ntuser/message.c @@ -673,6 +673,15 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT * *HitTest = HTCLIENT; } + if (gspv.bMouseClickLock && ((Msg->message == WM_LBUTTONUP) || (Msg->message == WM_LBUTTONDOWN))) + { + if (MsqIsClkLck(Msg, Remove)) + { + // FIXME: drop the message, hack: use WM_NULL + Msg->message = WM_NULL; + } + } + if(IS_BTN_MESSAGE(Msg->message, DOWN)) { /* generate double click messages, if necessary */ diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index 9b4c1d5fd62..1ed3ea3ef1a 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -232,6 +232,49 @@ MsqInsertSystemMessage(MSG* Msg) KeSetEvent(&HardwareMessageEvent, IO_NO_INCREMENT, FALSE); } +BOOL FASTCALL +MsqIsClkLck(LPMSG Msg, BOOL Remove) +{ + PTHREADINFO pti; + PWINSTATION_OBJECT WinStaObject; + PSYSTEM_CURSORINFO CurInfo; + BOOL Res = FALSE; + + pti = PsGetCurrentThreadWin32Thread(); + if (pti->Desktop == NULL) + { + return FALSE; + } + + WinStaObject = pti->Desktop->WindowStation; + + CurInfo = IntGetSysCursorInfo(WinStaObject); + + switch (Msg->message) + { + case WM_LBUTTONUP: + Res = ((Msg->time - CurInfo->ClickLockTime) >= gspv.dwMouseClickLockTime); + if (Res && (!CurInfo->ClickLockActive)) + { + CurInfo->ClickLockActive = TRUE; + } + break; + case WM_LBUTTONDOWN: + if (CurInfo->ClickLockActive) + { + Res = TRUE; + CurInfo->ClickLockActive = FALSE; + CurInfo->ClickLockTime = 0; + } + else + { + CurInfo->ClickLockTime = Msg->time; + } + break; + } + return Res; +} + BOOL FASTCALL MsqIsDblClk(LPMSG Msg, BOOL Remove) {