diff --git a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp index 29134371d4..a96e1e83ae 100644 --- a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp +++ b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp @@ -144,7 +144,19 @@ ATLASDLLIMPEXP void Atlas_StartWindow(const wchar_t* type) int argc = 1; char atlas[] = "atlas"; char *argv[] = {atlas, NULL}; +#ifndef __WXOSX__ wxEntry(argc, argv); +#else + // Fix for OS X init (see http://trac.wildfiregames.com/ticket/2427 ) + // If we launched from in-game, SDL started NSApplication which will + // break some things in wxWidgets + wxEntryStart(argc, argv); + wxTheApp->OnInit(); + wxTheApp->OnRun(); + wxTheApp->OnExit(); + wxEntryCleanup(); +#endif + #endif } @@ -175,6 +187,13 @@ class AtlasDLLApp : public wxApp { public: +#ifdef __WXOSX__ + virtual bool OSXIsGUIApplication() + { + return false; + } +#endif + virtual bool OnInit() { // _CrtSetBreakAlloc(5632);