Bug 531341 Stack overflow crash related to scrolling with trackpad and plugins [@ nsWindow::HandleScrollingPlugins] [@ _SEH_prolog4 ] r=VYV03354

This commit is contained in:
Masayuki Nakano 2010-01-28 17:39:51 +09:00
Родитель aaf4cdfdcc
Коммит e2a3abd319
2 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -381,7 +381,6 @@ nsWindow::nsWindow() : nsBaseWidget()
mHas3DBorder = PR_FALSE; mHas3DBorder = PR_FALSE;
mIsInMouseCapture = PR_FALSE; mIsInMouseCapture = PR_FALSE;
mIsTopWidgetWindow = PR_FALSE; mIsTopWidgetWindow = PR_FALSE;
mInScrollProcessing = PR_FALSE;
mUnicodeWidget = PR_TRUE; mUnicodeWidget = PR_TRUE;
mWindowType = eWindowType_child; mWindowType = eWindowType_child;
mBorderStyle = eBorderStyle_default; mBorderStyle = eBorderStyle_default;
@ -6051,6 +6050,11 @@ PRBool nsWindow::HandleScrollingPlugins(UINT aMsg, WPARAM aWParam,
point.x = GET_X_LPARAM(dwPoints); point.x = GET_X_LPARAM(dwPoints);
point.y = GET_Y_LPARAM(dwPoints); point.y = GET_Y_LPARAM(dwPoints);
static PRBool sIsProcessing = PR_FALSE;
if (sIsProcessing) {
return PR_TRUE; // the caller should handle this.
}
static PRBool sMayBeUsingLogitechMouse = PR_FALSE; static PRBool sMayBeUsingLogitechMouse = PR_FALSE;
if (aMsg == WM_MOUSEHWHEEL) { if (aMsg == WM_MOUSEHWHEEL) {
// Logitech (Logicool) mouse driver (confirmed with 4.82.11 and MX-1100) // Logitech (Logicool) mouse driver (confirmed with 4.82.11 and MX-1100)
@ -6115,20 +6119,15 @@ PRBool nsWindow::HandleScrollingPlugins(UINT aMsg, WPARAM aWParam,
// message themselves, some will forward directly back to us, while // message themselves, some will forward directly back to us, while
// others will call DefWndProc, which itself still forwards back to us. // others will call DefWndProc, which itself still forwards back to us.
// So if we have sent it once, we need to handle it ourself. // So if we have sent it once, we need to handle it ourself.
if (mInScrollProcessing) {
destWnd = parentWnd; // First time we have seen this message.
destWindow = parentWindow; // Call the child - either it will consume it, or
} else { // it will wind it's way back to us,triggering the destWnd case above
// First time we have seen this message. // either way,when the call returns,we are all done with the message,
// Call the child - either it will consume it, or sIsProcessing = PR_TRUE;
// it will wind it's way back to us,triggering the destWnd case above if (0 == ::SendMessageW(destWnd, aMsg, aWParam, aLParam))
// either way,when the call returns,we are all done with the message, aHandled = PR_TRUE;
mInScrollProcessing = PR_TRUE; sIsProcessing = PR_FALSE;
if (0 == ::SendMessageW(destWnd, aMsg, aWParam, aLParam))
aHandled = PR_TRUE;
destWnd = nsnull;
mInScrollProcessing = PR_FALSE;
}
return PR_FALSE; // break, but continue processing return PR_FALSE; // break, but continue processing
} }
parentWnd = ::GetParent(parentWnd); parentWnd = ::GetParent(parentWnd);
@ -6138,7 +6137,9 @@ PRBool nsWindow::HandleScrollingPlugins(UINT aMsg, WPARAM aWParam,
return PR_FALSE; return PR_FALSE;
if (destWnd != mWnd) { if (destWnd != mWnd) {
if (destWindow) { if (destWindow) {
sIsProcessing = PR_TRUE;
aHandled = destWindow->ProcessMessage(aMsg, aWParam, aLParam, aRetValue); aHandled = destWindow->ProcessMessage(aMsg, aWParam, aLParam, aRetValue);
sIsProcessing = PR_FALSE;
aQuitProcessing = PR_TRUE; aQuitProcessing = PR_TRUE;
return PR_FALSE; // break, and stop processing return PR_FALSE; // break, and stop processing
} }

Просмотреть файл

@ -416,7 +416,6 @@ protected:
PRPackedBool mInDtor; PRPackedBool mInDtor;
PRPackedBool mIsVisible; PRPackedBool mIsVisible;
PRPackedBool mIsInMouseCapture; PRPackedBool mIsInMouseCapture;
PRPackedBool mInScrollProcessing;
PRPackedBool mUnicodeWidget; PRPackedBool mUnicodeWidget;
PRPackedBool mPainting; PRPackedBool mPainting;
char mLeadByte; char mLeadByte;