diff --git a/mozilla/widget/src/mac/nsAppShell.cpp b/mozilla/widget/src/mac/nsAppShell.cpp index 1eb748a259c..f3ff8ca42f4 100644 --- a/mozilla/widget/src/mac/nsAppShell.cpp +++ b/mozilla/widget/src/mac/nsAppShell.cpp @@ -31,9 +31,18 @@ #include "nsMacMessageSink.h" //еее until this is moved into webshell(?) #include "nsMacMessagePump.h" #include "nsToolKit.h" +#include +#include +#include +#include +#include +#include +#include #include +PRBool nsAppShell::mInitializedToolbox = PR_FALSE; + //------------------------------------------------------------------------- // @@ -112,6 +121,19 @@ NS_IMETHODIMP nsAppShell::Exit() //------------------------------------------------------------------------- nsAppShell::nsAppShell() { + // once only, macintosh specific initialization + if (mInitializedToolbox == PR_FALSE) + { + mInitializedToolbox = PR_TRUE; + InitGraf(&qd.thePort); + InitFonts(); + InitWindows(); + InitMenus(); + TEInit(); + InitDialogs(0); + InitCursor(); + } + mRefCnt = 0; mExitCalled = PR_FALSE; } diff --git a/mozilla/widget/src/mac/nsAppShell.h b/mozilla/widget/src/mac/nsAppShell.h index cfc74289d08..178f7ce8643 100644 --- a/mozilla/widget/src/mac/nsAppShell.h +++ b/mozilla/widget/src/mac/nsAppShell.h @@ -45,6 +45,7 @@ class nsAppShell : public nsIAppShell auto_ptr mMacPump; nsMacMessageSink *mMacSink; //еее this will be COM, so use scc's COM_auto_ptr PRBool mExitCalled; + static PRBool mInitializedToolbox; // CLASS METHODS private: diff --git a/mozilla/widget/src/mac/nsToolkit.cpp b/mozilla/widget/src/mac/nsToolkit.cpp index f2ab6d482c7..dc8a791cb3e 100644 --- a/mozilla/widget/src/mac/nsToolkit.cpp +++ b/mozilla/widget/src/mac/nsToolkit.cpp @@ -19,16 +19,9 @@ #include "nsToolkit.h" #include "nsWindow.h" #include "nsGUIEvent.h" -#include -#include -#include -#include -#include -#include -#include -PRBool nsToolkit::mInit = PR_FALSE; + nsWindow* nsToolkit::mFocusedWidget = nsnull; @@ -41,19 +34,6 @@ nsWindow* nsToolkit::mFocusedWidget = nsnull; nsToolkit::nsToolkit() { NS_INIT_REFCNT(); - - // once only, macintosh specific initialization - if( mInit == PR_FALSE) - { - mInit = PR_TRUE; - InitGraf(&qd.thePort); - InitFonts(); - InitWindows(); - InitMenus(); - TEInit(); - InitDialogs(0); - InitCursor(); - } } diff --git a/mozilla/widget/src/mac/nsToolkit.h b/mozilla/widget/src/mac/nsToolkit.h index 36a4b280902..16c887b7e95 100644 --- a/mozilla/widget/src/mac/nsToolkit.h +++ b/mozilla/widget/src/mac/nsToolkit.h @@ -47,7 +47,6 @@ public: nsWindow* GetFocus() {return(mFocusedWidget);} private: - static PRBool mInit; static nsWindow* mFocusedWidget; };