diff --git a/mozilla/widget/src/cocoa/nsAppShell.mm b/mozilla/widget/src/cocoa/nsAppShell.mm index 0d6a9497471..085f3c1a158 100644 --- a/mozilla/widget/src/cocoa/nsAppShell.mm +++ b/mozilla/widget/src/cocoa/nsAppShell.mm @@ -152,7 +152,7 @@ nsAppShell::Init() void nsAppShell::ProcessGeckoEvents() { - if (mRunWasCalled) { + if (RunWasCalled()) { // We own the run loop. Interrupt it. It will be started again later // (unless exiting) by nsBaseAppShell. Trust me, I'm a doctor. [NSApp stop:nil]; diff --git a/mozilla/widget/src/mac/nsAppShell.cpp b/mozilla/widget/src/mac/nsAppShell.cpp index ced56ba88d6..991491f917d 100644 --- a/mozilla/widget/src/mac/nsAppShell.cpp +++ b/mozilla/widget/src/mac/nsAppShell.cpp @@ -212,7 +212,7 @@ nsAppShell::ProcessGeckoEvents(void* aInfo) { nsAppShell* self = NS_STATIC_CAST(nsAppShell*, aInfo); - if (self->mRunWasCalled) { + if (self->RunWasCalled()) { // We own the run loop. Interrupt it. It will be started again later // (unless exiting) by nsBaseAppShell. Trust me, I'm a doctor. ::QuitApplicationEventLoop(); diff --git a/mozilla/widget/src/xpwidgets/nsBaseAppShell.h b/mozilla/widget/src/xpwidgets/nsBaseAppShell.h index 454b897e5ba..2bff120dbbc 100644 --- a/mozilla/widget/src/xpwidgets/nsBaseAppShell.h +++ b/mozilla/widget/src/xpwidgets/nsBaseAppShell.h @@ -91,6 +91,14 @@ protected: */ virtual PRBool ProcessNextNativeEvent(PRBool mayWait) = 0; + /** + * Indicates whether or not nsIAppShell::Run was called. In an embedding + * application, the embedder usually spins up a native event loop on their + * own and does not call nsIAppShell::Run. In such cases, we have to go to + * extra lengths to properly hook ourselves into that native event loop. + */ + PRBool RunWasCalled() { return mRunWasCalled; } + private: PRBool DoProcessNextNativeEvent(PRBool mayWait);