Author: jimtabor
Date: Fri Nov 21 03:15:27 2014
New Revision: 65440
URL:
http://svn.reactos.org/svn/reactos?rev=65440&view=rev
Log:
[NtUser]
- Synchronize mouse messages. Best way to do this, just post the move message while it
occurs and just update it with recurrent information. The other way was to check time
stamps and that was a hackish headache. Then the scorn and reticule would erupt. So it was
easier to just post to the queue, update and if a mouse down up was captured than it would
be in the order as it was received.
- See CORE-8779 #resolve, CORE-8394, CORE-7797, CORE-7447.
Modified:
trunk/reactos/win32ss/user/ntuser/message.c
trunk/reactos/win32ss/user/ntuser/msgqueue.c
trunk/reactos/win32ss/user/ntuser/msgqueue.h
trunk/reactos/win32ss/user/ntuser/timer.c
Modified: trunk/reactos/win32ss/user/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/messag…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] Fri Nov 21 03:15:27 2014
@@ -858,17 +858,6 @@
return TRUE;
}
- if ((ProcessMask & QS_MOUSE) &&
- co_MsqPeekMouseMove( pti,
- RemoveMessages,
- Window,
- MsgFilterMin,
- MsgFilterMax,
- Msg ))
- {
- return TRUE;
- }
-
/* Check for hardware events. */
if ((ProcessMask & QS_INPUT) &&
co_MsqPeekHardwareMessage( pti,
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Fri Nov 21 03:15:27 2014
@@ -35,44 +35,6 @@
256);
return(STATUS_SUCCESS);
-}
-
-PWND FASTCALL
-IntChildrenWindowFromPoint(PWND pWndTop, INT x, INT y)
-{
- PWND pWnd, pWndChild;
-
- if ( !pWndTop )
- {
- pWndTop = UserGetDesktopWindow();
- if ( !pWndTop ) return NULL;
- }
-
- if (!(pWndTop->style & WS_VISIBLE)) return NULL;
- if ((pWndTop->style & WS_DISABLED)) return NULL;
- if (!IntPtInWindow(pWndTop, x, y)) return NULL;
-
- if (RECTL_bPointInRect(&pWndTop->rcClient, x, y))
- {
- for (pWnd = pWndTop->spwndChild;
- pWnd != NULL;
- pWnd = pWnd->spwndNext)
- {
- if (pWnd->state2 & WNDS2_INDESTROY || pWnd->state &
WNDS_DESTROYED )
- {
- TRACE("The Window is in DESTROY!\n");
- continue;
- }
-
- pWndChild = IntChildrenWindowFromPoint(pWnd, x, y);
-
- if (pWndChild)
- {
- return pWndChild;
- }
- }
- }
- return pWndTop;
}
PWND FASTCALL
@@ -446,9 +408,16 @@
}
if (MessageBits & QS_MOUSEMOVE) // ReactOS hard coded.
{ // Account for tracking mouse moves..
- if (--pti->nCntsQBits[QSRosMouseMove] == 0) ClrMask |= QS_MOUSEMOVE;
+ if (pti->nCntsQBits[QSRosMouseMove])
+ {
+ pti->nCntsQBits[QSRosMouseMove] = 0; // Throttle down count. Up to > 3:1
entries are ignored.
+ }
// Handle mouse move bits here.
- if (Queue->MouseMoved) ClrMask |= QS_MOUSEMOVE;
+ if (Queue->MouseMoved)
+ {
+ ClrMask |= QS_MOUSEMOVE;
+ Queue->MouseMoved = FALSE;
+ }
}
if (MessageBits & QS_MOUSEBUTTON)
{
@@ -502,12 +471,34 @@
ClearMsgBitsMask(pti, QS_PAINT);
}
+/*
+ Post Mouse Move.
+ */
VOID FASTCALL
MsqPostMouseMove(PTHREADINFO pti, MSG* Msg)
{
- pti->MessageQueue->MouseMoveMsg = *Msg;
- pti->MessageQueue->MouseMoved = TRUE;
- MsqWakeQueue(pti, QS_MOUSEMOVE, TRUE);
+ PUSER_MESSAGE Message;
+ PLIST_ENTRY ListHead;
+ PUSER_MESSAGE_QUEUE MessageQueue = pti->MessageQueue;
+
+ ListHead = &MessageQueue->HardwareMessagesListHead;
+
+ MessageQueue->MouseMoved = TRUE;
+
+ if (!IsListEmpty(ListHead->Flink))
+ { // Look at the end of the list,
+ Message = CONTAINING_RECORD(ListHead->Blink, USER_MESSAGE, ListEntry);
+ // If the mouse move message is existing,
+ if (Message->Msg.message == WM_MOUSEMOVE)
+ {
+ TRACE("Post Old MM Message in Q\n");
+ Message->Msg = *Msg; // Overwrite the message with updated data!
+ MsqWakeQueue(pti, QS_MOUSEMOVE, TRUE);
+ return;
+ }
+ }
+ TRACE("Post New MM Message to Q\n");
+ MsqPostMessage(pti, Msg, TRUE, QS_MOUSEMOVE, 0);
}
VOID FASTCALL
@@ -581,13 +572,14 @@
{
pti = pwnd->head.pti;
MessageQueue = pti->MessageQueue;
- // MessageQueue->ptiMouse = pti;
-
- if ( pti->TIF_flags & TIF_INCLEANUP || MessageQueue->QF_flags &
QF_INDESTROY)
+
+ if (MessageQueue->QF_flags & QF_INDESTROY)
{
- ERR("Mouse is over the Window Thread is Dead!\n");
+ ERR("Mouse is over a Window with a Dead Message Queue!\n");
return;
}
+
+ MessageQueue->ptiMouse = pti;
if (Msg->message == WM_MOUSEMOVE)
{
@@ -642,6 +634,7 @@
{
// ERR("ptiLastInput is set\n");
// ptiLastInput = pti; // Once this is set during Reboot or Shutdown, this
prevents the exit window having foreground.
+ // Find all the Move Mouse calls and fix mouse set active focus
issues......
}
TRACE("Posting mouse message to hwnd=%p!\n",
UserHMGetHandle(pwnd));
MsqPostMessage(pti, Msg, TRUE, QS_MOUSEBUTTON, 0);
@@ -1677,51 +1670,6 @@
return TRUE;
}
-BOOL APIENTRY
-co_MsqPeekMouseMove(IN PTHREADINFO pti,
- IN BOOL Remove,
- IN PWND Window,
- IN UINT MsgFilterLow,
- IN UINT MsgFilterHigh,
- OUT MSG* pMsg)
-{
- BOOL AcceptMessage;
- MSG msg;
- PUSER_MESSAGE_QUEUE MessageQueue = pti->MessageQueue;
-
- if(!(MessageQueue->MouseMoved))
- return FALSE;
-
- if (!MessageQueue->ptiSysLock)
- {
- MessageQueue->ptiSysLock = pti;
- pti->pcti->CTI_flags |= CTI_THREADSYSLOCK;
- }
-
- if (MessageQueue->ptiSysLock != pti)
- {
- ERR("MsqPeekMouseMove: Thread Q is locked to another pti!\n");
- return FALSE;
- }
-
- msg = MessageQueue->MouseMoveMsg;
-
- AcceptMessage = co_IntProcessMouseMessage(&msg, &Remove, MsgFilterLow,
MsgFilterHigh);
-
- if(AcceptMessage)
- *pMsg = msg;
-
- if(Remove)
- {
- ClearMsgBitsMask(pti, QS_MOUSEMOVE);
- MessageQueue->MouseMoved = FALSE;
- }
-
- MessageQueue->ptiSysLock = NULL;
- pti->pcti->CTI_flags &= ~CTI_THREADSYSLOCK;
- return AcceptMessage;
-}
-
/* check whether a message filter contains at least one potential hardware message */
static INT FASTCALL
filter_contains_hw_range( UINT first, UINT last )
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.h [iso-8859-1] Fri Nov 21 03:15:27 2014
@@ -54,8 +54,6 @@
/* True if a WM_MOUSEMOVE is pending */
BOOLEAN MouseMoved;
/* Current WM_MOUSEMOVE message */
- MSG MouseMoveMsg;
- /* Last click message for translating double clicks */
MSG msgDblClk;
/* Current capture window for this queue. */
PWND spwndCapture;
@@ -142,13 +140,6 @@
IN UINT MsgFilterHigh,
IN UINT QSflags,
OUT MSG* pMsg);
-BOOL APIENTRY
-co_MsqPeekMouseMove(IN PTHREADINFO pti,
- IN BOOL Remove,
- IN PWND Window,
- IN UINT MsgFilterLow,
- IN UINT MsgFilterHigh,
- OUT MSG* pMsg);
BOOLEAN FASTCALL MsqInitializeMessageQueue(PTHREADINFO, PUSER_MESSAGE_QUEUE);
PUSER_MESSAGE_QUEUE FASTCALL MsqCreateMessageQueue(PTHREADINFO);
VOID FASTCALL MsqCleanupThreadMsgs(PTHREADINFO);
Modified: trunk/reactos/win32ss/user/ntuser/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/timer.…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/timer.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/timer.c [iso-8859-1] Fri Nov 21 03:15:27 2014
@@ -315,7 +315,7 @@
if ( pDesk->dwDTFlags & DF_TME_HOVER &&
pWnd == pDesk->spwndTrack )
{
- Point = pWnd->head.pti->MessageQueue->MouseMoveMsg.pt;
+ Point = gpsi->ptCursor;
if ( RECTL_bPointInRect(&pDesk->rcMouseHover, Point.x, Point.y) )
{
if (pDesk->htEx == HTCLIENT) // In a client area.