mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-08 14:03:49 +00:00
Bug 708278 - Prevent recursion in ReportMoveEvent(), which can become infinite. r=bgirard a=maconly
This commit is contained in:
parent
6991ff4007
commit
b723654ff1
@ -342,6 +342,8 @@ protected:
|
||||
bool mFullScreen;
|
||||
bool mModal;
|
||||
|
||||
bool mInReportMoveEvent; // true if in a call to ReportMoveEvent().
|
||||
|
||||
PRInt32 mNumModalDescendents;
|
||||
InputContext mInputContext;
|
||||
};
|
||||
|
@ -139,6 +139,7 @@ nsCocoaWindow::nsCocoaWindow()
|
||||
, mSheetNeedsShow(false)
|
||||
, mFullScreen(false)
|
||||
, mModal(false)
|
||||
, mInReportMoveEvent(false)
|
||||
, mNumModalDescendents(0)
|
||||
{
|
||||
|
||||
@ -1364,6 +1365,15 @@ nsCocoaWindow::ReportMoveEvent()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
// Prevent recursion, which can become infinite (see bug 708278). This
|
||||
// can happen when the call to [NSWindow setFrameTopLeftPoint:] in
|
||||
// nsCocoaWindow::Move() triggers an immediate NSWindowDidMove notification
|
||||
// (and a call to [WindowDelegate windowDidMove:]).
|
||||
if (mInReportMoveEvent) {
|
||||
return;
|
||||
}
|
||||
mInReportMoveEvent = true;
|
||||
|
||||
UpdateBounds();
|
||||
|
||||
// Dispatch the move event to Gecko
|
||||
@ -1374,6 +1384,8 @@ nsCocoaWindow::ReportMoveEvent()
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
DispatchEvent(&guiEvent, status);
|
||||
|
||||
mInReportMoveEvent = false;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user