зеркало из https://github.com/mozilla/pjs.git
fix for bug 134437 - syncronous focus event causes reflow reentrancy
resulting in a crash on WIN32. fixed trough WM_SETFOCUS deferral sr= waterson r=kmccklusk
This commit is contained in:
Родитель
f6cf1c00e9
Коммит
76e726509e
|
@ -548,6 +548,8 @@ private:
|
||||||
|
|
||||||
static nsAttentionTimerMonitor *gAttentionTimerMonitor = 0;
|
static nsAttentionTimerMonitor *gAttentionTimerMonitor = 0;
|
||||||
|
|
||||||
|
PRBool gIsDestroyingAny = PR_FALSE;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// nsISupport stuff
|
// nsISupport stuff
|
||||||
|
@ -1387,7 +1389,11 @@ NS_METHOD nsWindow::Destroy()
|
||||||
mEventCallback = nsnull;
|
mEventCallback = nsnull;
|
||||||
if (gAttentionTimerMonitor)
|
if (gAttentionTimerMonitor)
|
||||||
gAttentionTimerMonitor->KillTimer(mWnd);
|
gAttentionTimerMonitor->KillTimer(mWnd);
|
||||||
|
|
||||||
|
gIsDestroyingAny = PR_TRUE;
|
||||||
VERIFY(::DestroyWindow(mWnd));
|
VERIFY(::DestroyWindow(mWnd));
|
||||||
|
gIsDestroyingAny = PR_FALSE;
|
||||||
|
|
||||||
mWnd = NULL;
|
mWnd = NULL;
|
||||||
//our windows can be subclassed by
|
//our windows can be subclassed by
|
||||||
//others and these namless, faceless others
|
//others and these namless, faceless others
|
||||||
|
@ -3730,6 +3736,8 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
|
|
||||||
|
if(!gIsDestroyingAny) {
|
||||||
result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus);
|
result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus);
|
||||||
if(gJustGotActivate) {
|
if(gJustGotActivate) {
|
||||||
gJustGotActivate = PR_FALSE;
|
gJustGotActivate = PR_FALSE;
|
||||||
|
@ -3739,7 +3747,11 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
||||||
if (nsWindow::gIsAccessibilityOn && !mRootAccessible && mIsTopWidgetWindow)
|
if (nsWindow::gIsAccessibilityOn && !mRootAccessible && mIsTopWidgetWindow)
|
||||||
CreateRootAccessible();
|
CreateRootAccessible();
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
|
nsToolkit *toolkit = NS_STATIC_CAST(nsToolkit *, mToolkit);
|
||||||
|
VERIFY(::PostMessage(toolkit->GetDispatchWindow(), WM_SETFOCUS,
|
||||||
|
wParam, lParam));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче