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;