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
This commit is contained in:
emaijala%kolumbus.fi
2006-11-19 21:13:25 +00:00
parent d6df742640
commit 484f5175e0

View File

@@ -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;