Commit in reactos/subsys/win32k on MAIN
include/msgqueue.h+21.27 -> 1.28
ntuser/msgqueue.c+70-161.73 -> 1.74
+72-16
2 modified files
don't hold more than one WM_MOUSEMOVE message at the same time in the message queue

reactos/subsys/win32k/include
msgqueue.h 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- msgqueue.h	24 Feb 2004 13:27:02 -0000	1.27
+++ msgqueue.h	28 Feb 2004 00:44:28 -0000	1.28
@@ -51,6 +51,8 @@
   FAST_MUTEX HardwareLock;
   /* Lock for the queue. */
   FAST_MUTEX Lock;
+  /* Pointer to the current WM_MOUSEMOVE message */
+  PUSER_MESSAGE MouseMoveMsg;
   /* True if a WM_QUIT message is pending. */
   BOOLEAN QuitPosted;
   /* The quit exit code. */

reactos/subsys/win32k/ntuser
msgqueue.c 1.73 -> 1.74
diff -u -r1.73 -r1.74
--- msgqueue.c	26 Feb 2004 22:23:54 -0000	1.73
+++ msgqueue.c	28 Feb 2004 00:44:28 -0000	1.74
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: msgqueue.c,v 1.73 2004/02/26 22:23:54 weiden Exp $
+/* $Id: msgqueue.c,v 1.74 2004/02/28 00:44:28 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -242,8 +242,9 @@
 MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
 			 PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
 			 PWINDOW_OBJECT ScopeWin, PUSHORT HitTest,
-			 PPOINT ScreenPoint, PBOOL MouseClick, BOOL FromGlobalQueue)
+			 PPOINT ScreenPoint, BOOL FromGlobalQueue)
 {
+  PUSER_MESSAGE_QUEUE ThreadQueue;
   USHORT Msg = Message->Msg.message;
   PWINDOW_OBJECT CaptureWin, Window = NULL;
   POINT Point;
@@ -349,8 +350,9 @@
     *Freed = TRUE;
     return(FALSE);
   }
-
-  if (Window->MessageQueue != PsGetWin32Thread()->MessageQueue)
+  
+  ThreadQueue = PsGetWin32Thread()->MessageQueue;
+  if (Window->MessageQueue != ThreadQueue)
   {
     if (! FromGlobalQueue)
     {
@@ -359,17 +361,38 @@
        * to move it to a different queue, perhaps because a new window
        * was created which now covers the screen area previously taken
        * by another window. To move it, we need to take it out of the
-       * old queue. Note that we're already holding the lock mutes of the
+       * old queue. Note that we're already holding the lock mutexes of the
        * old queue */
       RemoveEntryList(&Message->ListEntry);
+      
+      /* remove the pointer for the current WM_MOUSEMOVE message in case we
+         just removed it */
+      if(ThreadQueue->MouseMoveMsg == Message)
+      {
+        ThreadQueue->MouseMoveMsg = NULL;
+      }
     }
     IntLockHardwareMessageQueue(Window->MessageQueue);
-    InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
-                   &Message->ListEntry);
+    if((Message->Msg.message == WM_MOUSEMOVE) && Window->MessageQueue->MouseMoveMsg)
+    {
+      /* we do not hold more than one WM_MOUSEMOVE message in the queue */
+      Window->MessageQueue->MouseMoveMsg->Msg = Message->Msg;
+      ExFreePool(Message);
+      *Freed = TRUE;
+    }
+    else
+    {
+      InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
+                     &Message->ListEntry);
+      if(Message->Msg.message == WM_MOUSEMOVE)
+      {
+        Window->MessageQueue->MouseMoveMsg = Message;
+      }
+      *Freed = FALSE;
+    }
     IntUnLockHardwareMessageQueue(Window->MessageQueue);
     KeSetEvent(&Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
     IntReleaseWindowObject(Window);
-    *Freed = FALSE;
     return(FALSE);
   }
   
@@ -377,12 +400,26 @@
       !IntIsChildWindow(hWnd, Window->Self))
   {
     IntLockHardwareMessageQueue(Window->MessageQueue);
-    InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
-                   &Message->ListEntry);
+    if((Message->Msg.message == WM_MOUSEMOVE) && Window->MessageQueue->MouseMoveMsg)
+    {
+      /* we do not hold more than one WM_MOUSEMOVE message in the queue */
+      Window->MessageQueue->MouseMoveMsg->Msg = Message->Msg;
+      ExFreePool(Message);
+      *Freed = TRUE;
+    }
+    else
+    {
+      InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
+                     &Message->ListEntry);
+      if(Message->Msg.message == WM_MOUSEMOVE)
+      {
+        Window->MessageQueue->MouseMoveMsg = Message;
+      }
+      *Freed = FALSE;
+    }
     IntUnLockHardwareMessageQueue(Window->MessageQueue);
     KeSetEvent(&Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
     IntReleaseWindowObject(Window);
-    *Freed = FALSE;
     return(FALSE);
   }
   
@@ -452,7 +489,6 @@
   USHORT HitTest;
   POINT ScreenPoint;
   BOOL Accept, Freed;
-  BOOL MouseClick;
   PLIST_ENTRY CurrentEntry;
   PWINDOW_OBJECT DesktopWindow;
   PVOID WaitObjects[2];
@@ -493,12 +529,16 @@
 	  Accept = MsqTranslateMouseMessage(hWnd, FilterLow, FilterHigh,
 					    Current, Remove, &Freed,
 					    DesktopWindow, &HitTest,
-					    &ScreenPoint, &MouseClick, FALSE);
+					    &ScreenPoint, FALSE);
 	  if (Accept)
 	    {
 	      if (Remove)
 		{
 		  RemoveEntryList(&Current->ListEntry);
+		  if(MessageQueue->MouseMoveMsg == Current)
+		  {
+		    MessageQueue->MouseMoveMsg = NULL;
+		  }
 		}
 	      IntUnLockHardwareMessageQueue(MessageQueue);
               IntUnLockSystemHardwareMessageQueueLock(FALSE);
@@ -560,7 +600,7 @@
 	  Accept = MsqTranslateMouseMessage(hWnd, FilterLow, FilterHigh,
 					    Current, Remove, &Freed,
 					    DesktopWindow, &HitTest,
-					    &ScreenPoint, &MouseClick, TRUE);
+					    &ScreenPoint, TRUE);
 	  if (Accept)
 	    {
 	      /* Check for no more messages in the system queue. */
@@ -579,8 +619,22 @@
 	      if (!Remove)
 		{
                   IntLockHardwareMessageQueue(MessageQueue);
-		  InsertTailList(&MessageQueue->HardwareMessagesListHead,
-				 &Current->ListEntry);
+                  if((Current->Msg.message == WM_MOUSEMOVE) && MessageQueue->MouseMoveMsg)
+                  {
+                    /* we do not hold more than one WM_MOUSEMOVE message in the queue */
+                    MessageQueue->MouseMoveMsg->Msg = Current->Msg;
+                    *Message = MessageQueue->MouseMoveMsg;
+                    ExFreePool(Current);
+                  }
+                  else
+                  {
+		    InsertTailList(&MessageQueue->HardwareMessagesListHead,
+				   &Current->ListEntry);
+		    if(Current->Msg.message == WM_MOUSEMOVE)
+		    {
+		      MessageQueue->MouseMoveMsg = Current;
+		    }
+		  }
                   IntUnLockHardwareMessageQueue(MessageQueue);
 		}
 	      IntUnLockSystemHardwareMessageQueueLock(FALSE);
CVSspam 0.2.8