From 484f5175e02cf9c9ca7dcae29c298bcd8eb522ec Mon Sep 17 00:00:00 2001 From: "emaijala%kolumbus.fi" Date: Sun, 19 Nov 2006 21:13:25 +0000 Subject: [PATCH] Additional fix for bug 324131: Include mouse button states in NS_MOUSE_EXIT message. r/sr=roc git-svn-id: svn://10.0.0.236/trunk@215448 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsWindow.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 1ae46376a88..f1b188a44cf 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -4647,7 +4647,12 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT // EventStateManager doesn't convert this EXIT message to // a MOVE message (besides, WM_MOUSELEAVE doesn't have the position // in lParam). - DispatchMouseEvent(NS_MOUSE_EXIT, wParam, MINLONG | MINSHORT); + // We also need to check mouse button states and put them in for + // wParam. + WPARAM mouseState = (GetKeyState(VK_LBUTTON) ? MK_LBUTTON : 0) + | (GetKeyState(VK_MBUTTON) ? MK_MBUTTON : 0) + | (GetKeyState(VK_RBUTTON) ? MK_RBUTTON : 0); + DispatchMouseEvent(NS_MOUSE_EXIT, mouseState, MINLONG | MINSHORT); } break; #endif @@ -6364,12 +6369,12 @@ PRBool ChildWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, LPARA CaptureMouse(PR_TRUE); break; - // NS_MOUSE_MOVE and NS_MOUSE_EXIT are here because we need to make sure capture flag - // isn't left on after a drag where we wouldn't see a button up message (see bug 324131). + // NS_MOUSE_MOVE and NS_MOUSE_EXIT are here because we need to make sure capture flag + // isn't left on after a drag where we wouldn't see a button up message (see bug 324131). case NS_MOUSE_BUTTON_UP: - case NS_MOUSE_MOVE: - case NS_MOUSE_EXIT: - if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && mIsInMouseCapture) + case NS_MOUSE_MOVE: + case NS_MOUSE_EXIT: + if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && mIsInMouseCapture) CaptureMouse(PR_FALSE); break;