From 08efbf2ebab69229faef5249e34f6454d10b709c Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Wed, 10 May 2006 17:56:10 +0000 Subject: [PATCH] Make nsBaseAppShell::mRunWasCalled accessible to subclasses. Fixes mac bustage. git-svn-id: svn://10.0.0.236/trunk@196260 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/cocoa/nsAppShell.mm | 2 +- mozilla/widget/src/mac/nsAppShell.cpp | 2 +- mozilla/widget/src/xpwidgets/nsBaseAppShell.h | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) 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);