Author: mkupfer
Date: Mon Oct 12 23:08:35 2009
New Revision: 43420
URL:
http://svn.reactos.org/svn/reactos?rev=43420&view=rev
Log:
experimental mouse click lock feature
Modified:
trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Mon Oct 12
23:08:35 2009
@@ -197,6 +197,8 @@
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);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Mon Oct 12
23:08:35 2009
@@ -671,6 +671,15 @@
else
{
*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))
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Mon Oct 12
23:08:35 2009
@@ -233,6 +233,49 @@
}
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)
{
PTHREADINFO pti;