From c4bde9bbf1f61855b40ff9aa851e7646df631296 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Fri, 16 Apr 2004 18:53:53 +0000 Subject: [PATCH] properly remove mousemove messages svn path=/trunk/; revision=9165 --- reactos/subsys/win32k/eng/mouse.c | 10 +++++----- reactos/subsys/win32k/include/msgqueue.h | 2 +- reactos/subsys/win32k/ntuser/msgqueue.c | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index 274a8b0107d..171100f5f53 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -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: mouse.c,v 1.65 2004/04/09 20:03:16 navaraf Exp $ +/* $Id: mouse.c,v 1.66 2004/04/16 18:53:53 weiden Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Mouse @@ -297,7 +297,7 @@ MouseMoveCursor(LONG X, LONG Y) Msg.time = TickCount; Msg.pt.x = X; Msg.pt.y = Y; - MsqInsertSystemMessage(&Msg, TRUE); + MsqInsertSystemMessage(&Msg); res = TRUE; } @@ -454,7 +454,7 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount) } Msg.wParam = CurInfo->ButtonsDown; - MsqInsertSystemMessage(&Msg, FALSE); + MsqInsertSystemMessage(&Msg); } } } @@ -467,7 +467,7 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount) Msg.pt.x = CurInfo->x; Msg.pt.y = CurInfo->y; Msg.lParam = MAKELPARAM(CurInfo->x, CurInfo->y); - MsqInsertSystemMessage(&Msg, TRUE); + MsqInsertSystemMessage(&Msg); if (!CurInfo->SafetySwitch && 0 == CurInfo->SafetyRemoveCount && ((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y))) @@ -489,7 +489,7 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount) Msg.lParam = MAKELPARAM(CurInfo->x, CurInfo->y); Msg.pt.x = CurInfo->x; Msg.pt.y = CurInfo->y; - MsqInsertSystemMessage(&Msg, FALSE); + MsqInsertSystemMessage(&Msg); } ObDereferenceObject(InputWindowStation); diff --git a/reactos/subsys/win32k/include/msgqueue.h b/reactos/subsys/win32k/include/msgqueue.h index 47fea2ba92a..bc9f77a43d7 100644 --- a/reactos/subsys/win32k/include/msgqueue.h +++ b/reactos/subsys/win32k/include/msgqueue.h @@ -172,7 +172,7 @@ MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam); VOID FASTCALL MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam); VOID FASTCALL -MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg); +MsqInsertSystemMessage(MSG* Msg); BOOL FASTCALL MsqIsDblClk(LPMSG Msg, BOOL Remove); HWND FASTCALL diff --git a/reactos/subsys/win32k/ntuser/msgqueue.c b/reactos/subsys/win32k/ntuser/msgqueue.c index 3b20bc78d56..95e025ccb85 100644 --- a/reactos/subsys/win32k/ntuser/msgqueue.c +++ b/reactos/subsys/win32k/ntuser/msgqueue.c @@ -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.89 2004/04/16 01:27:44 weiden Exp $ +/* $Id: msgqueue.c,v 1.90 2004/04/16 18:53:53 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -138,7 +138,7 @@ MsqInitializeImpl(VOID) } VOID FASTCALL -MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg) +MsqInsertSystemMessage(MSG* Msg) { LARGE_INTEGER LargeTickCount; KIRQL OldIrql; @@ -150,7 +150,7 @@ MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg) IntLockSystemMessageQueue(OldIrql); /* only insert WM_MOUSEMOVE messages if not already in system message queue */ - if((Msg->message == WM_MOUSEMOVE) && RemMouseMoveMsg) + if(Msg->message == WM_MOUSEMOVE) mmov = SystemMessageQueueMouseMove; if(mmov != (ULONG)-1) @@ -240,7 +240,7 @@ MsqIsDblClk(LPMSG Msg, BOOL Remove) BOOL STATIC STDCALL MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT FilterLow, UINT FilterHigh, - PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed, BOOL RemoveWhenFreed, + PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed, PWINDOW_OBJECT ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue) { USHORT Msg = Message->Msg.message; @@ -268,9 +268,13 @@ MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT Filte if (Window == NULL) { - if(RemoveWhenFreed) + if(!FromGlobalQueue) { RemoveEntryList(&Message->ListEntry); + if(MessageQueue->MouseMoveMsg == Message) + { + MessageQueue->MouseMoveMsg = NULL; + } } ExFreePool(Message); *Freed = TRUE; @@ -452,17 +456,13 @@ MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, Current->Msg.message <= WM_MOUSELAST) { Accept = MsqTranslateMouseMessage(MessageQueue, hWnd, FilterLow, FilterHigh, - Current, Remove, &Freed, TRUE, + Current, Remove, &Freed, DesktopWindow, &ScreenPoint, FALSE); if (Accept) { if (Remove) { RemoveEntryList(&Current->ListEntry); - if(MessageQueue->MouseMoveMsg == Current) - { - MessageQueue->MouseMoveMsg = NULL; - } } IntUnLockHardwareMessageQueue(MessageQueue); IntUnLockSystemHardwareMessageQueueLock(FALSE); @@ -520,7 +520,7 @@ MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, const ULONG ActiveStamp = HardwareMessageQueueStamp; /* Translate the message. */ Accept = MsqTranslateMouseMessage(MessageQueue, hWnd, FilterLow, FilterHigh, - Current, Remove, &Freed, FALSE, + Current, Remove, &Freed, DesktopWindow, &ScreenPoint, TRUE); if (Accept) {