From 5200ea03658fcba2a92ee67fda8fb62021e90ba4 Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Sun, 28 Sep 2014 07:03:51 +0000 Subject: [PATCH] Fixes starting Atlas from in-game on OS X, patch by trompetin17, refs #2427 This was SVN commit r15821. --- .../tools/atlas/AtlasUI/Misc/DLLInterface.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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);