mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
Correctly move hardware messages between private queues. Fixes bugs
#156 and #162. svn path=/trunk/; revision=7796
This commit is contained in:
parent
aa31a3cd3a
commit
b95a905321
1 changed files with 15 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: msgqueue.c,v 1.63 2004/01/15 21:01:40 gvg Exp $
|
/* $Id: msgqueue.c,v 1.64 2004/01/20 23:35:59 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -240,7 +240,7 @@ BOOL STATIC STDCALL
|
||||||
MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
||||||
PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
|
PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
|
||||||
PWINDOW_OBJECT ScopeWin, PUSHORT HitTest,
|
PWINDOW_OBJECT ScopeWin, PUSHORT HitTest,
|
||||||
PPOINT ScreenPoint, PBOOL MouseClick)
|
PPOINT ScreenPoint, PBOOL MouseClick, BOOL FromGlobalQueue)
|
||||||
{
|
{
|
||||||
USHORT Msg = Message->Msg.message;
|
USHORT Msg = Message->Msg.message;
|
||||||
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
||||||
|
@ -333,6 +333,17 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
||||||
|
|
||||||
if (Window->MessageQueue != PsGetWin32Thread()->MessageQueue)
|
if (Window->MessageQueue != PsGetWin32Thread()->MessageQueue)
|
||||||
{
|
{
|
||||||
|
if (! FromGlobalQueue)
|
||||||
|
{
|
||||||
|
DPRINT("Moving msg between private queues\n");
|
||||||
|
/* This message is already queued in a private queue, but we need
|
||||||
|
* 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 */
|
||||||
|
RemoveEntryList(&Message->ListEntry);
|
||||||
|
}
|
||||||
ExAcquireFastMutex(&Window->MessageQueue->HardwareLock);
|
ExAcquireFastMutex(&Window->MessageQueue->HardwareLock);
|
||||||
InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
|
InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
|
||||||
&Message->ListEntry);
|
&Message->ListEntry);
|
||||||
|
@ -448,7 +459,7 @@ MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
|
||||||
Accept = MsqTranslateMouseMessage(hWnd, FilterLow, FilterHigh,
|
Accept = MsqTranslateMouseMessage(hWnd, FilterLow, FilterHigh,
|
||||||
Current, Remove, &Freed,
|
Current, Remove, &Freed,
|
||||||
DesktopWindow, &HitTest,
|
DesktopWindow, &HitTest,
|
||||||
&ScreenPoint, &MouseClick);
|
&ScreenPoint, &MouseClick, FALSE);
|
||||||
if (Accept)
|
if (Accept)
|
||||||
{
|
{
|
||||||
if (Remove)
|
if (Remove)
|
||||||
|
@ -515,7 +526,7 @@ MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
|
||||||
Accept = MsqTranslateMouseMessage(hWnd, FilterLow, FilterHigh,
|
Accept = MsqTranslateMouseMessage(hWnd, FilterLow, FilterHigh,
|
||||||
Current, Remove, &Freed,
|
Current, Remove, &Freed,
|
||||||
DesktopWindow, &HitTest,
|
DesktopWindow, &HitTest,
|
||||||
&ScreenPoint, &MouseClick);
|
&ScreenPoint, &MouseClick, TRUE);
|
||||||
ExAcquireFastMutex(&HardwareMessageQueueLock);
|
ExAcquireFastMutex(&HardwareMessageQueueLock);
|
||||||
if (Accept)
|
if (Accept)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue